使用 ssh-copy-id
复制ssh证书到服务器
# ssh -i ~/.ssh/mykey user@host
ssh-copy-id -i ~/.ssh/id_rsa.pub -p 22 [email protected]
输入密码,登录一次,完成证书上传
下次登录直接免密码
# ssh user@host
ssh [email protected] -p 22
使用 ssh-copy-id
复制ssh证书到服务器
# ssh -i ~/.ssh/mykey user@host
ssh-copy-id -i ~/.ssh/id_rsa.pub -p 22 [email protected]
输入密码,登录一次,完成证书上传
下次登录直接免密码
# ssh user@host
ssh [email protected] -p 22