在Windows上的MobaXterm中,vagrant ssh无法正常工作 [英] vagrant ssh not working in MobaXterm on Windows
问题描述
我已经找到"SSH到Windows中的Vagrant框" 和将git bin目录添加到我的Windows PATH.我通过启动CMD并键入ssh
验证了它是否有效,并收到了使用情况消息. (在将git bin目录添加到我的路径之前,CMD抱怨ssh
不是有效的命令.)
I have already found "SSH to Vagrant box in Windows" and added the git bin directory to my windows PATH. I verified that it worked by starting CMD and typing ssh
, and got a usage message. (Before adding the git bin directory to my path, CMD complained that ssh
wasn't a valid command.)
但是...当我从MobaXterm运行vagrant ssh
时,遇到与以前相同的错误. (充满红宝石错误的页面对我无济于事.)当我以VAGRANT_LOG=debug vagrant ssh
身份运行它时,我看到:
However...when I run vagrant ssh
from MobaXterm, I get the same error I did before. (A page full of ruby errors that aren't helpful to me.) When I run it as VAGRANT_LOG=debug vagrant ssh
, I see:
INFO subprocess: Starting process: ["C:\\Users\\(myname)\\DOCUME~1\\MOBAXT~1\\slash\\bin/ssh.EXE"]
这是错误的ssh可执行文件;这是MobaXterm中安装的版本,如果从CMD窗口运行则无法正常运行.
This is the wrong ssh executable; it's the one installed in MobaXterm and it doesn't work if run from a CMD window.
如何使vagrant ssh
正常工作?
推荐答案
诀窍的一部分是,我不想想要对任意命令使用Windows PATH,甚至不是ssh, .我想将MobaXterm中的版本用于所有内容.我想要的是能够像在Linux或Mac上一样运行vagrant ssh
.
Part of the trick is that I don't want to use the Windows PATH for arbitrary commands—not even for ssh, really. I want to use the versions in MobaXterm for everything. All I want is to be able to run vagrant ssh
the same way I would on Linux or Mac.
我一直在使用的变通方法是:
The workaround I have been using, which I found somewhere online (but can't find the page again), is:
vagrant ssh-config > vagrant-ssh
ssh -F vagrant-ssh default # Works exactly the way `vagrant ssh` should
默认"是典型的无业游民环境只有一个无业游民的框的框名.如果有多个框,请用框名称替换默认":
"default" is the box name for a typical Vagrant environment with only a single vagrant box. If there is more than one box, replace "default" with the box name:
ssh -F vagrant-ssh host001 # Works the way `vagrant ssh host001` would on another system
这是一个很好的解决方法,只需对工作流程进行最少的更改即可.但是我仍然想一种方法来使vagrant ssh
工作而无需在我的游民目录中添加额外的文件.
This is a good workaround with minimal changes required to workflow. But I'd still like a way to get vagrant ssh
working without needing the extra file in my vagrant directory.
这篇关于在Windows上的MobaXterm中,vagrant ssh无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!