contiv/remotessh

on Baremetal sudo does not work

gaurav-dalvi opened this issue · 5 comments

I had to this in order to work with sudo.

https://www.shell-tips.com/2014/09/08/sudo-sorry-you-must-have-a-tty-to-run-sudo/

node.RunCommandWithOutput("sudo pkill netmaster")
This does not give any error. But unless you do what is mentioned in the above link, You wont able to perform any command with sudo.

running ssh -t option will solve this issue.

erikh commented

there's a call that should fix it in the SSH package, but passwordless sudo must be enabled before any of this will work.

sudo typically does not require a tty unless it's asking for a password. Can you verify this is not the case? Then I'll patch it in quickly.

erikh commented

ah I should have read that link first. I'll give you a patch later tonight to play with.

@erikh : Could you please give me the patch you are talking about ?

Correct me If I am wrong :

I need to add ssh -t option somewhere in vagrantssh library code. If thats true then I will spend some time to get this done.

erikh commented

I haven't gotten to it quite yet. We need to request the TTY. There's a
call for this:
https://godoc.org/golang.org/x/crypto/ssh#Session.RequestPty

If you wish to implement it go for it! Let me or madhav know if you run
into trouble.

-Erik

On 23 May 2016, at 17:29, Gaurav Dalvi wrote:

@erikh : Could you please give me the patch you are talking about ?

Correct me If I am wrong :

I need to add ssh -t option somewhere in vagrantssh library code. If
thats true then I will spend some time to get this done.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#12 (comment)