ssh禁止密码登录

查看配置

1
cat /etc/ssh/sshd_config | grep -C 1 'PasswordAuthentication'

修改配置

1
sed -ri 's/#PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config

检查配置

1
cat /etc/ssh/sshd_config | grep -C 1 'PasswordAuthentication'

重启SSH

1
systemctl restart ssh

坚持原创技术分享,您的支持将鼓励我继续创作!