cat /etc/redhat-release
ssh -V
rpm -qa | grep openssh | xargs rpm -e --nodeps 卸载openssh
yum install -y gcc gcc-c++ glibc openssl openssl-devel pcre-devel pam-devel
阿里云镜像站下载openssh的版本
wget 连接
tar xf 减压
cd openssh-8.8p1
./configure --prefix=/usr/local/ssh --sysconfdir=/etc/ssh --with-pam
make && make install
无报错即可
[root@centos openssh-8.8p1]# cd /etc/init.d/
[root@centos init.d]# cp /root/openssh-8.8p1/contrib/redhat/sshd.init /etc/init.d/sshd
[root@centos init.d]# chmod u+x /etc/init.d/sshd
[root@centos init.d]# chkconfig --add sshd
[root@centos init.d]# cp /root/openssh-8.8p1/sshd_config /etc/ssh/ssh_config
cp: overwrite ‘/etc/ssh/ssh_config’? y
[root@centos init.d]# cp -r /usr/local/ssh/bin/* /usr/bin/
[root@centos init.d]# cp -r /usr/local/ssh/sbin/* /usr/sbin/
sed -i '/^#PermitRootLogin/s/#PermitRootLogin yes/PermitRootLogin yes/' /etc/ssh/sshd_config
chmod 600 /etc/ssh/*
systemctl restart sshd
//service sshd restart
ssh -V