【问题标题】:Changing vagrant ssh user creates permission erros更改 vagrant ssh 用户会产生权限错误
【发布时间】:2014-02-26 02:15:45
【问题描述】:

我正在尝试更改为我的办公室创建的 Vagrant 盒子。目前,像大多数盒子一样,运行vagrant sshvagrant 用户身份登录我,但团队成员不得不使用su - xxadmin 切换到我们的主要管理员用户而感到沮丧。

在我的 Vagrantfile 中,我添加了:config.ssh.username = "xxadmin",但随后在运行 vagrant up 时开始收到常见的 Vagrant 错误:

[default] Configuring and enabling network interfaces...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

sed -e '/^#VAGRANT-BEGIN/,/^#VAGRANT-END/ d' /etc/network/interfaces > /tmp/vagrant-network-interfaces

Stdout from the command:



Stderr from the command:

sudo: no tty present and no askpass program specified

当运行vagrant halt:

[default] Attempting graceful shutdown of VM...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

shutdown -h now

Stdout from the command:



Stderr from the command:

sudo: no tty present and no askpass program specified

这是怎么回事?为什么简单地更改 ssh 用户会产生这些错误?如何找到解决方案?

规格:

  • OS X Mavericks(主机)
  • 流浪者 1.3.5
  • Virtualbox 4.3.2
  • Debian 7 Wheezy(虚拟机客户端)

【问题讨论】:

    标签: ssh debian virtualbox vagrant


    【解决方案1】:

    在您的框中,您需要通过运行visudo 并添加以下内容来修改您的 sudoers 文件:

    Defaults    !requiretty
    

    【讨论】:

      【解决方案2】:

      在我确定我的用户的 NOPASSWD sudoers 条目不是 squashed 之前,我一直遇到这个错误。

      【讨论】:

        猜你喜欢
        • 2018-02-19
        • 1970-01-01
        • 1970-01-01
        • 2021-02-24
        • 1970-01-01
        • 1970-01-01
        • 2022-08-07
        • 2018-03-15
        • 2015-10-17
        相关资源
        最近更新 更多