【发布时间】:2014-04-23 10:41:48
【问题描述】:
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: no tty present and no askpass program specified
Sorry, try again.
sudo: 3 incorrect password attempts
Chef 客户端成功运行,我们的说明书都已安装。其中之一是 sudo 社区食谱,我认为我们删除了 vagrant 用户需要执行 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-butcher 插件上报告这个? github.com/cassianoleal/vagrant-butcher
-
sudo组具有 sudo 访问权限,但它不是无密码的。 @tmatilai 的回答似乎很到位。
标签: chef-infra vagrant sudo