xshell密钥登录服务器

其实很简单

1 xshell 生成pub key 。 在工具 -> 用户密钥管理。 生成 。另存为id_rsa_1024.pub

2.服务器上ssh-keygen 

3.将生成的文件id_rsa_1024.pub 上传到服务器。

mv id_rsa_1024.pub /root/.ssh/authorized_keys
chmod 600 /root/.ssh/authorized_keys

  

4.vim /etc/ssh/sshd_config 重启sshd

PasswordAuthentication no
systemctl restart sshd

  

 这和linux上面的ssh-keygen 其实一样。没啥区别。

原文地址:https://www.cnblogs.com/gqdw/p/4166283.html