我已经在我的服务器windows 2008上安装了git windows,我也使用git bash生成密钥。
我尝试使用此命令ssh-copy-id user@123.45.56.78
/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 123.45.56.78 port 22: Connection refused
我怎么能修复这个...在我的ubuntu服务器上我只对它有问题。
答案 0 :(得分:0)
您必须使用相同的密钥或注册主服务器下的所有密钥。
获得钥匙后,您就可以连接。
How to tell if the keys are copied successfully?
user@linux ~ $ ssh-copy-id user@remote
/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: INFO: 1 key(s) remain to be installed
Number of key(s) added: 1
在您的情况下,您会看到错误,这意味着ssh-copy-id
不起作用,请按照下一部分进行操作:
If the ssh-copy-id doesn't work?
Simpy cat
并手动将文件复制到服务器,它将对您有用。
# Copy the output of private key
# you can also copy the public key if you need to
cat ~/.ssh/id_rsa