热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

CentOS7安装OpenSSL1.0.1m和OpenSSH6.8p1

#下载软件wgethttp:zlib.netzlib-1.2.8.tar.gzwgetftp:ftp.openssl.orgsourceopenssl-1.0.1

# 下载软件

wget http://zlib.net/zlib-1.2.8.tar.gz
wget ftp://ftp.openssl.org/source/openssl-1.0.1m.tar.gz
wget http://www.ftp.ne.jp/OpenBSD/OpenSSH/portable/openssh-6.8p1.tar.gz


# 事前准备,安装 telnet 防止 ssh 登陆不了
# 具体查看这篇文章: http://blog.csdn.net/zhouzme/article/details/46461177


# 安装数据压缩函数库

tar -zxvf zlib-1.2.8.tar.gzcd zlib-1.2.8
./configure
make
make install
cd ..


# 编译安装 OpenSSL 
# 查看当前版本
# openssl version -a

tar -zxvf openssl-1.0.1m.tar.gz cd openssl-1.0.1m/
./config --prefix=/usr shared zlib
make
make install
cd ..


# 替换旧版 指定了 --prefix=/usr 则无需下面的操作了
#mv /usr/bin/openssl /usr/bin/openssl.old
#mv /usr/include/openssl /usr/include/openssl.old
#ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
#ln -s /usr/local/ssl/include/openssl/ /usr/include/openssl
# 配置库文件搜索路径
#echo "/usr/local/ssl/lib" >> /etc/ld.so.conf
#ldconfig



# 编译安装 OpenSSH
# 若出现 PAM headers not found 错误则
# 安装 yum -y install pam pam-devel

yum -y install pam pam-devel

tar -zxvf openssh-6.8p1.tar.gz
cd openssh-6.8p1/
./configure --prefix=/usr --syscOnfdir=/etc/ssh --with-pam --with-zlib --with-md5-passwords
make
make install


# 补充下:安装时如果出现 公私密钥找不到等问题,如下图,请先忽略,继续执行下面的覆盖操作,sshd 重新加载配置后即可解决



# 覆盖旧配置文件
cp ./contrib/redhat/sshd.init /etc/init.d/sshd
chmod +x /etc/init.d/sshd
chkconfig –add sshd

cp sshd_config /etc/ssh/sshd_config
cp sshd /usr/sbin/sshd
cp -p ssh /usr/bin/ssh

# 重新加载配置

systemctl reload sshd

# 此时不要退出当前 ssh 窗口,先新开个窗口测试登陆若没有问题则完成

# 若登录时出现能连接去无法登录提示密码不接受之类的

# 尝试关闭 SELinux

vi /etc/selinux/config

# 将 

SELINUX=enforcing 

# 修改为

SELINUX=disabled

# 执行更新

setenforce 0






推荐阅读
author-avatar
心悦随鑫_196
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有