gpt4 book ai didi

visual-studio-code - Visual Studio Code 远程 SSH 在 ssh_config 中使用 Windows 用户名而不是用户名

转载 作者:行者123 更新时间:2023-12-03 15:29:45 25 4
gpt4 key购买 nike

我在 Windows 7 上使用 Visual Studio Code,以及 Microsoft 的远程 SSH 扩展。我添加了新的远程主机,并将配置保存在 ssh_config 文件中。

当我打开该文件时,一切看起来都正常,UserHost值。但是,当扩展要求我输入密码时,我可以看到它没有使用 myuser@myremotehost.com ,这些值写在 ssh_config 文件中,而是使用正确的主机,但它也使用我的 Windows 用户名而不是我的用户名在 ssh_config 文件中设置。

有什么解决办法吗?

最佳答案

我发现在 .ssh 配置文件的主机定义中包含用户名为我修复了它。

编辑 C:/Users/me/.ssh/config 的内容
从:

Host bar
User foo
HostName bar
ForwardAgent yes

到:
Host foo@bar
User foo
HostName bar
ForwardAgent yes

关于visual-studio-code - Visual Studio Code 远程 SSH 在 ssh_config 中使用 Windows 用户名而不是用户名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58578397/

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