ssh-copy-id 无效

ssh-copy-id 无效

我正在尝试将我的公钥传输到我的服务器。我运行了 ssh-copy-id 来执行此操作,但什么也没发生。也没有创建 .ssh 和 authorized_keys 文件夹。公钥不在我的主目录中,但我认为它存储在其他地方。我做错了什么?

/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 -- if you are prompted now it is to install the new keys
john@mydomain's password:

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh 'john@mydomain'"
and check to make sure that only the key(s) you wanted were added.

答案1

当您生成密钥时,如果您未指定完整路径,则这通常是密钥所在的目录。试试这个?

从你的 ~/ 开始

cd
mkdir .ssh
chmod 700 .ssh
cd .ssh
ssh-keygen -t rsa -f id_rsa
ssh-copy-id <ip>

相关内容