gpt4 book ai didi

ssh - 更改给定主机的 ssh 身份

转载 作者:行者123 更新时间:2023-12-02 13:53:00 28 4
gpt4 key购买 nike

所以我在两台机器上都安装了 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

或者只是谷歌的 ssh 配置。

关于ssh - 更改给定主机的 ssh 身份,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8106952/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com