【问题标题】:Why am I getting prompted for sudo password via knife-vsphere when giving --ssh-user & --ssh-password params?为什么在提供 --ssh-user 和 --ssh-password 参数时会通过刀 vsphere 提示我输入 sudo 密码?
【发布时间】:2015-08-14 05:32:48
【问题描述】:

我正在尝试让 knife-vsphere 在我的 vCenter 环境中工作。我有一个脚本可以从模板启动虚拟机,然后引导它并运行食谱食谱以完成。但是,系统提示我提供 sudo 密码。这是预期的吗?我提供了 '--ssh-user' 和 '--ssh-password' 参数,并且在收到提示时,我输入了相同的密码,然后 chef build 继续。

难道没有办法让这件事摆脱困境吗?我可能错过了什么?

谢谢!

【问题讨论】:

  • ssh 和 sudo 有不同的用途 - ssh 用于通过网络建立安全连接, sudo 用于提升权限 - 因此这种行为不会让我感到惊讶。 stackoverflow.com/questions/25215604/… 可能适合你。

标签: chef-infra sudo knife


【解决方案1】:

正如 cmets 中所指出的,提示 sudo 的是操作系统(不是 Chef 或刀)。不希望这样,您必须在模板中配置用户使用 sudo 时不提示输入密码。

https://askubuntu.com/questions/192050/how-to-run-sudo-command-with-no-password

谢谢rhashimoto。

【讨论】:

    猜你喜欢
    • 2010-11-24
    • 2017-11-12
    • 1970-01-01
    • 2016-04-08
    • 2012-08-11
    • 2023-03-20
    • 2019-03-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多