1、生成本地 SSH 密钥对:
ssh-keygen -t rsa
默认位置是 ~/.ssh/id_rsa.pub
2、将公钥复制到目标服务器
ssh-copy-id -i ~/.ssh/id_rsa.pub [-p 22] <username>@<server_ip>
OK
1、生成本地 SSH 密钥对:
ssh-keygen -t rsa
默认位置是 ~/.ssh/id_rsa.pub
2、将公钥复制到目标服务器
ssh-copy-id -i ~/.ssh/id_rsa.pub [-p 22] <username>@<server_ip>
OK
评论区