VMware Cloud Community
srinivas_vm
Contributor
Contributor

Script to change root password of ubuntu 12.04

Need help to change the root password for Linux VM.

It throws the following error when i run on Linux VM(Ubuntu 12.04)

I am using below cmd to change root password and I got error as shown below:

invoke-vmscript -vm vmname -scripttext "echo 'root:newpwd' | chpasswd" -guestuser root -guestpassword password9

Error Message:

Invoke-vmscript failed to authenicate with the guest operating system using the supplied credentials.

Tags (1)
0 Kudos
1 Reply
markvm2
Enthusiast
Enthusiast

If i remember correctly this is because you cannot login or run commands as root or sudo up through invoke-vmscript since it is not associated with a terminal. There is an easy fix for this in the sudoers file by adding "Defaults:username !requiretty" under the Defaults requiretty section or just comment out Defaults requiretty to allow all users.

0 Kudos