CentOS7 升级openssh8.9
一、查看当前版本、下载相关软件包
二、安装zlib
[root@localhost opt]# tar -zxvf zlib-1.2.11.tar.gz [root@localhost opt]# cd zlib-1.2.11/ [root@localhost zlib-1.2.11]# ./configure && make && make install
三、安装openssl
[root@localhost opt]# tar -zxvf openssl-1.1.1m.tar.gz [root@localhost openssl-1.1.1m]# ./config --prefix=/usr/ && make && make install [root@localhost openssl-1.1.1m]# openssl version OpenSSL 1.1.1m 14 Dec 2021
三、安装pam
[root@localhost openssl-1.1.1m]# yum install -y pam pam-devel
四、安装openssh
[root@localhost openssl-1.1.1m]# rm -rf /etc/ssh/* [root@localhost opt]# tar -zxvf openssh-8.9p1.tar.gz [root@localhost opt]# cd openssh-8.9p1/ [root@localhost openssh-8.9p1]# ./configure --prefix=/usr/ --sysconfdir=/etc/ssh --with-zlib --with-md5-passwords --with-pam [root@localhost openssh-8.9p1]# make && make install [root@localhost openssh-8.9p1]# ssh -V OpenSSH_8.9p1, OpenSSL 1.1.1m 14 Dec 2021
五、修改openssh配置文件
[root@localhost openssh-8.9p1]# vim /etc/ssh/sshd_config PermitRootLogin yes PubkeyAuthentication yes PasswordAuthentication yes
六、配置pam及开机启动
[root@localhost openssh-8.9p1]# cp -a contrib/redhat/sshd.init /etc/init.d/sshd [root@localhost openssh-8.9p1]# cp -a contrib/redhat/sshd.pam /etc/pam.d/sshd.pam [root@localhost openssh-8.9p1]# chmod +x /etc/init.d/sshd
[root@localhost ~]# service sshd start
[root@localhost ~]# chkconfig --add sshd
[root@localhost ~]# chkconfig sshd on
七、升级完成
[root@localhost ~]# ssh -V OpenSSH_8.9p1, OpenSSL 1.1.1m 14 Dec 2021 [root@localhost ~]#