I want to remotely shutdown an ESX host from a physical windows 2008 server using the plink and "shutdown" command. This is what I have so far:
plink -ssh -t root@esx_ip_address -l druser -pw shutdown sudo shutdown -h
I have created a local user on the host called druser and he is in a group caller druser
I have created a line in the sudoers file:
%druser ALL=(ALL) NOPASSWD: /usr/bin/shutdown -h
After I run it, I am still prompted for a password.
Any assistance would be appreciated.
You can try ssh passwordless keys. http://bkb.vmware.com/kb/1002866
ssh has to be enabled for security purposes
ssh has to be enabled for security purposes
I don't know that I understand your statement. I am suggesting that you look at using ssh keys rather than passwords. Have a look at putty keygen.
Use the full path of your command (/usr/bin/shutdown -h) as written in the sudoers file.
Andre
Using PowerCli is easy . .
Have a look at
I tried that. It is still prompting me for a password.