gpt4 book ai didi

linux - ssh 连接,known_hosts 为空,但我收到警告 "REMOTE HOST IDENTIFICATION HAS CHANGED"并询问密码

转载 作者:太空宇宙 更新时间:2023-11-04 05:50:36 24 4
gpt4 key购买 nike

我和一个 friend 使用免费的 ssh 聊天应用程序。以前,他可以毫无问题地连接到我的聊天室(通过 ssh)。

但是我更改了 Linux 中的用户 session ,并且必须使用以下命令生成新的 ssh key :

ssh-keygen -t rsa -b 4096 -C "myemail@example.com"

我从新用户 session 开始 ssh 聊天。效果很好。 (我可以通过另一台本地计算机连接到聊天)

但是当我的 friend 尝试连接到聊天时,他收到以下警告:

enter image description here

“有时”,shell 要求他输入密码( friend 告诉我的)因此,我要求他通过以下方式清除警告消息中显示的文件known_hosts:

ssh-keygen -R myip
ssh-keygen -R -F myip
sudo ssh-keygen -R myip
sudo ssh-keygen -R - F myip
#we try severals commands

现在文件known_hosts是空的,但是当 friend 尝试通过ssh连接到我的聊天时总是收到警告。

我不明白为什么他会收到此警告,而known_host(警告消息中显示的路径)为空? (计算机重新启动)

为什么有时 shell 会要求他输入密码? (抱歉,我没有更多详细信息...)。从我的初始用户 session 开始,当我的 friend 连接到 ssh 应用程序时,从未询问过密码

最佳答案

当我们通过 ssh-kegen 删除主机时,我们忘记添加端口号。

所以,我的 friend 执行:

ssh-kegen -R [xxx.xxx.xxx.xxx]:yyyy
# xxx.xxx.xxx.xxx the ip of the server where is the ssh chat
# yyyy, le port number used by the application

这有效:)他可以毫无问题地连接到聊天室

关于linux - ssh 连接,known_hosts 为空,但我收到警告 "REMOTE HOST IDENTIFICATION HAS CHANGED"并询问密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39296457/

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