Centos7允许使用密码登录

 
现在使用云主机比较多,所以一般都是使用秘钥登录,当做一个集群的时候需要几台机器之间免密登录时,就需要修改他的配置文件了,刚做运维那会儿,很熟练,现在忘得差不多了,特此记录一下,下次又这个需求时就不需要到处查资料了。

1、vim /etc/ssh/sshd_config  保证下面两个配置是如下设置

#允许使用密码登录
PasswordAuthentication yes
#允许root认证登录
PermitRootLogin yes

2、重启sshd

systemctl restart sshd

3、设置免密登录

ssh-kengen
ssh-copy-id -i .ssh/id_rsa.pub  root@172.0.0.3
原文地址:https://www.cnblogs.com/lemon-le/p/11168609.html