Why am I getting prompted for sudo password via knife-vsphere when giving --ssh-user & --ssh-password params?

ε祈祈猫儿з 提交于 2019-12-25 04:18:13

问题


I'm trying to get knife-vsphere working in my vCenter environment. I have a script working that spins up a VM from a template then bootstraps it and runs cookbook recipes to completion. However, I get prompted to supply a sudo password. Is this expected? I supplied the '--ssh-user' and '--ssh-password' params and, upon being prompted, I'm typing the same password in and then chef build continues.

isn't there a way to make this hands off? what may I have missed?

Thanks!


回答1:


As pointed out in the comments, it was the OS (not Chef or knife) that was prompting for sudo. Don't want that, you have to configure the user in the template to not be prompted for passwords when using sudo.

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

Thanks rhashimoto.



来源:https://stackoverflow.com/questions/30561953/why-am-i-getting-prompted-for-sudo-password-via-knife-vsphere-when-giving-ssh

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!