无法复制rsa密钥

时间:2016-12-14 06:11:55

标签: ubuntu ssh digital-ocean

当我尝试运行ssh-copy-id时,我正在关注错误:

abcd@hostOnDigitalOcean:~/.ssh$ ssh-copy-id xyz@targetHostIP
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/abcd/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

/usr/bin/ssh-copy-id: ERROR: ssh: connect to host targetHostIP port 22: Connection timed out

我试过ssh-copy-id -i <path_of_id_rsa.pub> xyz@targetHostIP 但同样的错误。

1 个答案:

答案 0 :(得分:0)

您可以手动复制。

cat ~/.ssh/id_rsa.pub

sshtargetHostIP

~/.ssh/authorized_keys

结尾处粘贴