耿昭

导航

ubuntu16.04 ssh禁止密钥登陆

1 在服务器上生成密钥  # ssh-keygen

2 创建目录   # tounch authorized_keys

 

3 给权限     #  chmod 600 authorized_keys

4  修改/etc/ssh/sshd_config

#禁用密码验证
PasswordAuthentication no
#启用密钥验证
RSAAuthentication yes
PubkeyAuthentication yes

5 重启ssh服务

service sshd restart #centos系统

 

posted on 2020-03-03 14:19  耿昭  阅读(775)  评论(0编辑  收藏  举报