SCP:“主机密钥验证失败。失去连接”尝试将文件从远程服务器复制到WSL时

发布于 2025-02-10 02:48:56 字数 576 浏览 1 评论 0原文

我在远程服务器上有一个用户,我们将其称为remote_user@remote_server

我的WSL2 Ubuntu上也有一个用户,我们称其为wsl_user@localhost>

当我尝试使用命令scp -v -o strictKeyChecking = no remote_user@remote_server:/path/to/file.txt wsl_user@&lt< localhost>:/path/path/path/to/directory 在主机上计算机,它要求提供远程服务器的密码(成功进行身份验证),但是

Host key verification failed.
lost connection

当我使用localhost作为< localhost>时,它会输出。

我尝试使用主机计算机的IP地址和WSL2实例的IP地址,但两者都挂起,然后进行连接时间

PS:我可以进入他们两个。

I have a user at a remote server, let's call it remote_user@remote_server.

I also have a user on my WSL2 Ubuntu, let's call it wsl_user@<localhost>.

When I tried to use the command scp -v -o StrictKeyChecking=no remote_user@remote_server:/path/to/file.txt wsl_user@<localhost>:/path/to/directory on my host computer, it asked for the remote server's password (which successfully authenticates), but then it outputs

Host key verification failed.
lost connection

when I use localhost as <localhost>.

I have tried using both the IP address of the host computer and the IP address of the WSL2 instance, but both just hangs, and then does a Connection timed out.

P.S: I can ssh into both of them.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

软糯酥胸 2025-02-17 02:48:56

好吧,我以某种方式通过将其分解为较小的命令,又名

scp -v remote_user@remote_server:/path/to/file.txt file.txt\
&& scp -v file.txt wsl_user@localhost:/path/to/directory \
&& rm file.txt

Well, I somehow kinda circumvented the problem using by breaking it into smaller commands, aka

scp -v remote_user@remote_server:/path/to/file.txt file.txt\
&& scp -v file.txt wsl_user@localhost:/path/to/directory \
&& rm file.txt
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文