前言 很多时候为了安全,我们会使用ssh登陆,但是密码会保留,以下禁用密码登陆方法 服务器操作 1.登陆服务器后编辑 /etc/ssh/sshd_config 文件 vim /etc/ssh/sshd_config 下面3个注释打开并编辑如下 AuthorizedKeysFile .ssh/authorized_keys //公钥公钥认证文件 PubkeyAuthentication yes //可以使用录 PasswordAuthentication no //不允许使用密码登录