xshell

ssh免密登录

生成密钥

ssh-keygen -t rsa -f ~/.ssh/my-ssh-key -C [USERNAME]


然后生成my-ssh-key, my-ssh-key.pub公私钥

然后把my-ssh-key.pub内容添加到要登录的服务器 [USERNAME]/.ssh/authorized_keys文件内

然后客户端只要登录引用my-ssh-key即可,如:

ssh root@192.168.50.1 -i ~/.ssh/my-ssh-key