Hi,
I trying to execute a command using Invoke-SshCommand. While executing a command with sudo, its giving error bcz password not passed for sudo. So please anyone help me on how to deal with.
ex:
New-SshSession -ComputerName "XYZ" -UserName "xyz" -PassWord "*******"
Invoke-SsCommand -CompterName "XYZ" -Command "Sudo mkdir test"
Remove-SshSession
error is: had an error: sudo: no tty present and no askpass program specified
So the directory was not created. I manually checked the same command, asking for sudo password.
Thanks,
Bhaskar.
I trying to execute a command using Invoke-SshCommand. While executing a command with sudo, its giving error bcz password not passed for sudo. So please anyone help me on how to deal with.
ex:
New-SshSession -ComputerName "XYZ" -UserName "xyz" -PassWord "*******"
Invoke-SsCommand -CompterName "XYZ" -Command "Sudo mkdir test"
Remove-SshSession
error is: had an error: sudo: no tty present and no askpass program specified
So the directory was not created. I manually checked the same command, asking for sudo password.
Thanks,
Bhaskar.