当试图“cat /etc/chef/client.pem”时,Vagrant :: Butcher“sudo:没有tty存在且没有指定askpass程序”

Ubuntu 10.04.1 LTS与Vagrant 1.4.3和Vagrant :: Butcher 2.1.5.

我在“vagrant up”结束时收到以下错误

...
[2014-03-17T22:50:56+00:00] INFO: Chef Run complete in 245.448117502 seconds
[2014-03-17T22:50:56+00:00] INFO: Running report handlers
[2014-03-17T22:50:56+00:00] INFO: Report handlers complete

[Butcher] Creating /home/testuser/vagrant_test/.vagrant/butcher
[Butcher] Failed to create /home/testuser/vagrant_test/.vagrant/butcher/DEV-35-51-client.pem: Vagrant::Errors::VagrantError - The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command Failed!

cat /etc/chef/client.pem

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: 3 incorrect password attempts

Chef客户端成功运行,我们的cookbook都已安装完毕.其中一个是sudo社区食谱,我想我们吹走了一个条目,流浪者用户需要执行cat来读取client.pem文件.

谁能告诉我那可能是什么?

更新:

1)vagrant用户是“sudo”组的一部分:

$grep sudo /etc/group
sudo:x:27:vagrant

2)sudoers文件包含一个条目,让“sudo”组运行任何命令:

# This file is managed by Chef.
# Do NOT modify this file directly.

Defaults      env_reset
Defaults      secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# User privilege specification
root      ALL=(ALL:ALL) ALL
nagios    ALL=(ALL) nopASSWD: /usr/local/nagios/libexec/


# Members of the group 'admin' may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo     ALL=(ALL:ALL) ALL

#includedir /etc/sudoers.d

解决方法

这最终不是流浪汉问题;该插件只是碰巧遇到了问题.此外任何以下的流浪手术也会失败.

Vagrant需要无密码的sudo权限.似乎基本框在/ etc / sudoers中使用sudo cookbook覆盖它.

您至少有以下选择:

>将节点[‘authorization’] [‘sudo’] [‘passwordless’]属性设置为true.
>根本不要包括sudo cookbook的认配方.
>使用sudo LWRP授予对vagrant用户的无密码sudo访问权限.>使用或构建已使用/etc/sudoers.d/的基本框.

相关文章

在Linux系统中,设置ARP防火墙可以通过多种方法实现,包括使...
在Linux环境下,使用Jack2进行编译时,可以采取以下策略来提...
`getid`命令在Linux系统中用于获取当前进程的有效用户ID(EU...
在Linux环境下,codesign工具用于对代码进行签名,以确保其完...
Linux中的`tr`命令,其英文全称是“transform”,即转换的意...
Linux中的ARP防火墙是一种用于防止ARP欺骗攻击的安全措施,它...