非Sudo无业游民用户的无业游民失败 [英] Vagrant Up by Non-Sudo Vagrant User fails

查看:184
本文介绍了非Sudo无业游民用户的无业游民失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在vagrant(Ubuntu 12.04 OS)中创建了一个新的非sudo用户(user1),并将不安全的公钥添加到user1授权密钥文件中。在游荡文件中,将默认用户添加为 user1:

I created a new non-sudo user(user1) in vagrant(Ubuntu 12.04 OS), and added the insecure public key to the user1 authorised key file. In vagrant file, added the default user as "user1" :

config.ssh.default.username = "user1"

现在流浪汉失败了,并显示以下错误消息:

Now vagrant up is failing with following error message:

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

mkdir -p /vagrant

Stdout from the command:

Stderr from the command:

sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: 3 incorrect password attempts

但是如果将sudo用户设置为默认用户,那么流浪汉成功了。
任何人都可以帮助我进行一些更改,以使非sudo用户无所事事。

But if am setting the sudo user for default user, then vagrant up is successful. Can anyone help me with the changes I need to do to enable vagrant up for non-sudo users.

推荐答案

Vagrant需要对VM的几乎所有操作都具有root / sudo权限;例如配置网络,安装共享文件夹,运行配置程序等。因此,即使您设法避免使用sudo,也不会获得非常有用的VM。

Vagrant requires root/sudo permissions on the VM for almost all of it's operations; like configuring the networking, mounting shared folders, running provisioners, etc. So you wouldn't get very useful VM without sudo even if you managed to avoid it.

您只需要访客的sudo访问权限。流浪者命令本身可以(并且应该)以非root用户身份在主机上运行。

Note that you only need sudo access on the guest. Vagrant commands itself can (and should) be run as a non-root user on the host.

这篇关于非Sudo无业游民用户的无业游民失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆