1 ssh连接是默认端口22

ssh-keygen
ssh-copy-id -i ~/.ssh/id_rsa_for252.pub root@10.199.160.252

2 ssh连接不是默认端口22

ssh-keygen
scp ~/.ssh/id_rsa.pub username@192.168.20.201:~/home
# 切换到服务器B 终端,在服务器B执行
cat ~/home/id_rsa.pub >> ~/.ssh/authorized_keys

标签: none

评论已关闭