Hi,
I was trying to access and execute the commands on remote Linux machine of CentOs-OpenLogic. But while executing the commands with sudo option, i was getting error like tty required. My code is as follows:
New-SshSessions -ComputerName <name.cloudapp.net> -Username <name> -Keyfile <path to key file>
nvoke-SshCommand -ComputerName <name.cloudapp.net> -Command "sudo mkdir testfolder"
Remove-Sshsession
The error is "sudo: sorry, you must have a tty to run sudo", but the same script is working for Ubuntu OS. I was unable to figure out what exactly the problem was.
It is an urgent issue, please anyone help me on this.
Thanks and Regards,
Bhaskar D
Comments: ** Comment from web user: drieseng **
I was trying to access and execute the commands on remote Linux machine of CentOs-OpenLogic. But while executing the commands with sudo option, i was getting error like tty required. My code is as follows:
New-SshSessions -ComputerName <name.cloudapp.net> -Username <name> -Keyfile <path to key file>
nvoke-SshCommand -ComputerName <name.cloudapp.net> -Command "sudo mkdir testfolder"
Remove-Sshsession
The error is "sudo: sorry, you must have a tty to run sudo", but the same script is working for Ubuntu OS. I was unable to figure out what exactly the problem was.
It is an urgent issue, please anyone help me on this.
Thanks and Regards,
Bhaskar D
Comments: ** Comment from web user: drieseng **
This is not a SSH.NET issue, but you can find a solution here:
http://unix.stackexchange.com/questions/122616/why-do-i-need-a-tty-to-run-sudo-if-i-can-sudo-without-a-password