所以我在两台机器上都安装了 CYGWIN。
如果我这样做它会起作用:
ssh -i desktop_rsa root@remoteserver
这需要我输入密码
ssh root@remoteserver
如何更改 ssh 的默认身份,以便它选择正确的身份?
我尝试编辑我的known_hosts 文件,看起来像这样,末尾带有身份:
remote_server_ip ssh-rsa AAAAB3NzaC1yc2Esome_big_public_key_here0Dk44YdG///bz desktop_rsa
谢谢!
最佳答案
编辑您的 .ssh/config 文件,添加以下内容:
Host remoteserver
IdentityFile desktop_rsa
编辑其中远程服务器是您要连接的服务器,desktop_rsa 是您的身份文件的路径。您可以通过
获取更多信息man ssh_config
或者直接在 google 上搜索 ssh 配置。
关于ssh - 更改给定主机的 ssh 身份,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8106952/