CentOS 7上升级openssh7.5

升级过程中失败了好多次,终于都搞定,把记录发出来给大家参考。

wget http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-7.5p1.tar.gz
tar -zxvf openssh-7.5p1.tar.gz 
cd openssh-7.5p1
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-md5-passwords --with-pam --with-tcp-wrappers --with-ssl-dir=/usr/local/ssl --without-hardening
make && make install
cp ./contrib/redhat/sshd.init /etc/init.d/sshd
chmod u+x /etc/init.d/sshd
chkconfig --add sshd
cp ssh_config /etc/ssh/ssh_config
y
cp -p sshd_config /etc/ssh/sshd_config
y
ssh -V


修改配置文件,允许root登录
vi /etc/ssh/sshd_config
最后一行添加 PermitRootLogin yes
service sshd restart

[root@kif ~]# yum remove openssh -y

[root@kif openssh-7.5p1]# cp ./contrib/redhat/sshd.init /etc/init.d/sshd
cp: overwrite ‘/etc/init.d/sshd’? y
[root@kif openssh-7.5p1]# chmod u+x /etc/init.d/sshd
[root@kif openssh-7.5p1]# chkconfig --add sshd
[root@kif openssh-7.5p1]# cp ssh_config /etc/ssh/ssh_config
cp: overwrite ‘/etc/ssh/ssh_config’? y
[root@kif openssh-7.5p1]# cp -p sshd_config /etc/ssh/sshd_config
cp: overwrite ‘/etc/ssh/sshd_config’? y
[root@kif openssh-7.5p1]# ssh -V
OpenSSH_7.5p1, OpenSSL 1.0.1e-fips 11 Feb 2013
[root@kif openssh-7.5p1]# service sshd start
Starting sshd (via systemctl):                             [  OK  ]
[root@kif openssh-7.5p1]# vi /etc/ssh/sshd_config
[root@kif openssh-7.5p1]# service sshd restart
Restarting sshd (via systemctl):                           [  OK  ]
[root@kif openssh-7.5p1]#

你可能感兴趣的:(openssh)