git 以下 SSH 命令以非零退出状态响应
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/36334270/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
The following SSH command responded with a non-zero exit status
提问by Methosslayer
each time I do the vagrant up command I get the error
每次我执行 vagrant up 命令时,我都会收到错误消息
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
chown `id -u vagrant`:`id -g vagrant` /vagrant
Stdout from the command:
Stderr from the command:
chown: changing ownership of ‘/vagrant': Not a directory
I can't find any solutions ( already tried to change the sudoers file but don't know exactly what to change)
我找不到任何解决方案(已经尝试更改 sudoers 文件,但不知道要更改什么)
回答by kenorb
chown: changing ownership of ‘/vagrant': Not a directory
chown:更改“/vagrant”的所有权:不是目录
This sounds like /vagrant
is Not a directory, which probably it is a file, therefore remove the file and re-try again.
这听起来像是/vagrant
是不是一个目录,因此,这可能是一个文件,删除文件并重新再试一次。
Or try to re-create your VM again, also double check your Vagrantfile
if such file is not created.
或者尝试再次重新创建您的虚拟机,Vagrantfile
如果未创建此类文件,请再次检查您的虚拟机。
To investigate the issue further, run the vagrant in the debug mode, e.g.
要进一步调查问题,请在调试模式下运行 vagrant,例如
vagrant up --debug
回答by Pysis
I have been trying to get a Vagrant 1.9.1-VirtualBox 5.1.10-Fedora 25 x64-Atomic host image running on my Windows 10 x64 Host.
我一直在尝试让 Vagrant 1.9.1-VirtualBox 5.1.10-Fedora 25 x64-Atomic 主机映像在我的 Windows 10 x64 主机上运行。
I thought the Vagrant plugin vbguest didn't work well with the Atomic host type, as it mentioned during the provisioning.
我认为 Vagrant 插件 vbguest 不适用于 Atomic 主机类型,正如它在配置期间提到的那样。
Turns out the error still occurred for me, and I found this bug report: Vagrant cannot create synced folder.
结果发现错误仍然发生在我身上,我发现了这个错误报告:Vagrant cannot create synced folder。
dustymabeseems to support the situation with a temporary workaround until the bug is fixed by using this line of code:
在使用以下代码行修复错误之前,dustymabe似乎通过临时解决方法支持这种情况:
config.vm.synced_folder "/tmp", "/vagrant", disabled: 'true'
jorti, the user that seems to be having the same issue as I, has used these lines of code both to workaround the bug, and set-up their own pathway to continue working with the same feature:
jorti,似乎和我有同样问题的用户,已经使用这些代码行来解决该错误,并设置自己的路径以继续使用相同的功能:
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.synced_folder ".", "/home/vagrant/provision", type: "rsync"
This issue was reported on Nov 25 2016 at 14:45:46, and was only commented on currently just up to 3 days after that time.
此问题于 2016 年 11 月 25 日 14:45:46 报告,目前仅在该时间之后最多 3 天才评论。
回答by ikrabbe
This is no permission problem, but a simple error message, that the expected home directory "/vagrant" does not exist. It may be a file or just not existent.
这不是权限问题,而是一条简单的错误消息,即预期的主目录“/vagrant”不存在。它可能是一个文件或只是不存在。
Anyway this command has to be called by user root.
无论如何,这个命令必须由用户 root 调用。
Just create that directory:
只需创建该目录:
mkdir /vagrant
as user root.
作为用户根。