I am connecting remotely to a Centos 7.5 VM in Azure - it works fine for commands not requiring sudo privileges.
My user has been configured to accept sudo commands with no password (i.e. I can run ls -la /root with no password provided) but this does not work when connecting from my PowerShell script - which looks like this:
&($plinkpath + "plink.exe") $username@$servername $command .. I also tried:
&($plinkpath + "plink.exe") -pw $password
$username@$servername $command
The error I get is essentially asking for me to provide a password interactively via keyboard:
plink.exe : -- Keyboard-interactive authentication prompts from server
Any thoughts how to resolve this? Thanks.
ChrisB