Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have two machines master, slave. They have passwordless ssh setup between them. i.e master -> master and master -> slave

I noticed the following problem

user@master$ ssh master sudo whoami
sudo: no tty present and no askpass program specified
user@master$ ssh slave sudo whoami
root
user@master$ ssh -t master sudo whoami
[sudo] password for user:

I am suprprised i have to type password for local machine but not for remote! How can i bypass the sudo prompt on master itself?

Thanks

share|improve this question
What user are you logging in as on slave, and what OS is it using? Also, paste the contents of your .ssh/config file - make sure to change the IPs though :) – jackweirdy Mar 1 at 11:20
by default ssh takes the current user, which above case is "user" ..both machines have same user names. I am using ubuntu oneiric on master and natty on slave. – FUD Mar 1 at 11:23
In which case you should move this question to askubuntu.com :) – jackweirdy Mar 1 at 11:42

migrated from stackoverflow.com Mar 1 at 15:16

1 Answer

Add your user entry to /etc/sudoers, by using visudo tool.

Line should look like:

user ALL=(ALL) NOPASSWD: ALL

This would allow you to bypass password prompt.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.