This project is read-only.

Invoke-SsshCommand password problem

Apr 13, 2014 at 6:47 AM
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.
Jan 16, 2015 at 2:52 PM
I have the same problem on CentOS 7 (Azure).
Jan 16, 2015 at 3:52 PM
Edited Jan 16, 2015 at 3:53 PM