更新密码 passwd
重启SSH服务 systemctl restart sshd.service
升级yum yum update
备份sshd配置文件 scp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
修改sshd配置文件 vim /etc/ssh/sshd_config(port xx/PubkeyAuthentication yes/PasswordAuthentication no)
查看当前SElinux ssh端口 semanage port -l | grep ssh
SELinux ssh端口 semanage port -a -t ssh_port_t -p tcp xxxx
然后确认一下是否添加进去 semanage port -l | grep ssh如果成功会输出 ssh_port_t tcp 20000, 22重启SSH服务 systemctl restart sshd.service
创建密匙 ssh-keygen
备份sshd配置文件 scp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
授权密匙 scp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys
查阅并下载私匙文件 cat /root/.ssh/id_rsa
安装vim yum -yinstall vim-enhanced