linux服务器禁用密码登陆

前言

很多时候为了安全,我们会使用ssh登陆,但是密码会保留,以下禁用密码登陆方法

服务器操作

1.登陆服务器后编辑 /etc/ssh/sshd_config 文件

vim /etc/ssh/sshd_config 

下面3个注释打开并编辑如下

AuthorizedKeysFile   .ssh/authorized_keys   //公钥公钥认证文件
PubkeyAuthentication yes   //可以使用录
PasswordAuthentication no  //不允许使用密码登录

版权声明:本文为qq_31628559原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。