代码改变世界

opensshd 源码升级

2018-02-06 18:22  那个,我  阅读(568)  评论(0编辑  收藏  举报

1. 检查当前版本:
[root@oracle ~]# ssh -V
OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013

2.卸载openssh
[root@oracle ~]# yum erase openssh -y
Removed:
openssh.x86_64
Dependency Removed:
openssh-clients.x86_64
openssh-server.x86_64


#安装回来 yum install -y openssh openssh-clients openssh-server

3.安装相关包
yum install -y gcc zlib zlib-devel pam pam-devel
#yum install -y openssl openssl-devel 如果openssl 做过升级,省略这里

4. 解压并配置 openssh-7.9p1
tar -xzvf openssh-7.9p1.tar.gz
cd openssh-7.9p1
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-md5-passwords --with-pam

5. 安装openssh-7.9p1
make&&make install

 

4.替换init.d/sshd启动服务
cd contrib/redhat;
cp sshd.init /etc/init.d/sshd;
chmod u+x /etc/init.d/sshd;
chkconfig --add sshd;
service sshd restart

#第一次sshd重启会失败 

5.检查当前openssh版本
ssh -V
sshd -V
OpenSSH_7.9p1, OpenSSL 1.0.1e-fips 11 Feb 2013