0
点赞
收藏
分享

微信扫一扫

如何禁止掉root登录,使用key密钥登录

小a草 2022-08-01 阅读 107


 在Linux系统下执行命令:

ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

vim /etc/ssh/sshd_config

AuthorizedKeysFile      .ssh/authorized_keys
RSAAuthentication       yes
PubkeyAuthentication yes
PasswordAuthentication no

service sshd restart 

 

举报

相关推荐

0 条评论