# mv /etc/ssh/ /etc/ssh.old
# mv /etc/init.d/sshd /etc/init.d/sshd.old
# rpm -e --nodeps $(rpm -qa |grep openssh)
# rpm -e --noscripts openssh-server
# rpm -qa |grep openssh
# yum install wget gcc openssl-devel pam-devel rpm-build tcp_wrappers-devel -y
# wget -P /usr/src/ https://openbsd.hk/pub/OpenBSD/OpenSSH/portable/openssh-8.1p1.tar.gz
# cd /usr/src/
# tar xf openssh-8.1p1.tar.gz
# cd openssh-8.1p1
# ./configure --prefix=/usr --sysconfdir=/etc/ssh --with-pam --with-zlib --with-md5-passwords --with-tcp-wrappers
# make
# make install
# cp contrib/redhat/sshd.init /etc/init.d/sshd
# echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config
# chkconfig --add sshd
# chkconfig sshd on
# service sshd restart
如果你的系统是RedHat 7.x
或CentOS 7.x
则用如下命令添加到系统服务和防火墙过滤规则
# systemctl enable sshd
# systemctl restart sshd
# firewall-cmd --permanent --add-service=ssh
firewall-cmd --reload
# ssh -V
OpenSSH_8.1p1, OpenSSL 1.0.2k-fips 26 Jan 2017