如何修复 ssh-copy-id 连接超时错误?

如何修复 ssh-copy-id 连接超时错误?

我按照自动化 ssh 登录的步骤登录后,最终断开了与服务器的连接。

# ssh-keygen
# ssh-copy-id userid@hostname -p 2242
# 
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/user/.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 userid@hostname port 2242: Connection timed out

我不知道它没有完成将密钥导入服务器。

相关内容