Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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?


share|improve this question

migrated from Mar 1 '13 at 15:16

This question came from our site for professional and enthusiast programmers.

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 '13 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 '13 at 11:23
In which case you should move this question to :) – jackweirdy Mar 1 '13 at 11:42

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

Line should look like:


This would allow you to bypass password prompt.

share|improve this answer

You must log in to answer this question.