安装之前可以先试试yum更新,若是可以更新,就不需要往下看了
centos7
$ yum update openssh -y
重启sshd
$ systemctl restart sshd
系统版本
[root@centos7-demo ~]# uname -a
Linux centos7-demo 5.4.104-1.el7.elrepo.x86_64 #1 SMP Mon Mar 8 16:59:45 EST 2021 x86_64 x86_64 x86_64 GNU/Linux
[root@centos7-demo ~]# ssh -V
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
[root@centos7-demo ~]#
安装telnet,防止ssh升级问题导致连接不上服务器
yum install xinetd telnet-server -y
cat >>/etc/securetty << \EOF
pts/0
pts/1
pts/2
pts/3
EOF
tail -5 /etc/securetty
[root@linux ~]# vim /etc/xinetd.d/telnet
# default: on
# description: The telnet server serves telnet sessions; it uses \
# unencrypted username/password pairs for authentication.
service telnet
{
flags = REUSE
socket_type = stream
wait