1,解压
[root@ecs-36f8-0823274 openssh-8.8p1]# tar zxvf openssh-8.8p1.tar.gz
2,安装依赖
[root@ecs-36f8-0823274 openssh-8.8p1]# yum install -y gcc gcc-c++ glibc make autoconf openssl openssl-devel pcre-devel pam-devel
3,备份原ssh
[root@ecs-36f8-0823274 openssh-8.8p1]# mv /etc/ssh /root/ssh
4,编译安装
[root@ecs-36f8-0823274 openssh-8.8p1]# ./configure --prefix=/usr/ --sysconfdir=/etc/ssh
[root@ecs-36f8-0823274 openssh-8.8p1]# make
[root@ecs-36f8-0823274 openssh-8.8p1]# make install
5,配置systemd
注:升级后openfile等参数修改的可能未生效,修改配置文件:
~~~
echo 'UsePAM yes' >> /etc/ssh/sshd_config
~~~
[root@ecs-36f8-0823274 openssh-8.8p1]# cp contrib/redhat/sshd.init /etc/init.d/
[root@ecs-36f8-0823274 openssh-8.8p1]# /etc/init.d/sshd.init start
[root@ecs-36f8-0823274 openssh-8.8p1]# cp /run/systemd/generator.late/sshd.init.service /usr/lib/systemd/system/sshd.service
[root@ecs-36f8-0823274 openssh-8.8p1]# systemctl daemon-reload
[root@ecs-36f8-0823274 openssh-8.8p1]# systemctl restart sshd