第一步
输入命令: ssh-copy-id user@host
更多
ssh-copy-id [-f] [-n] [-i identity file] [-p port] [-o ssh_option] [user@]hostname
示例
ssh-copy-id user@host
ssh -i ~/.ssh/mykey user@host
第二步
输入服务器密码
成功!
测试
ssh user@host
此时应当是不用输入密码可以登录了!
参考更多:https://www.ssh.com/academy/ssh/copy-id