Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

It is possible to log in automatically as root after typing sudo su - without entering password again? I know it is not safe, but I want this behavior just for specific IP addresses

Thank you, Alex

share|improve this question
Yes, but as I said earlier, I want this behavior for specific IPs. P.S. Not duplicate :) – Alex Rose Apr 25 '13 at 11:31
opps sorry ...deleted – Qasim Apr 25 '13 at 11:36
possible duplicate of sudoers - simple explanation requested – RobotHumans Apr 26 '13 at 0:16
this other duplicate has in one of the answers the host syntax – RobotHumans Apr 26 '13 at 0:16
been there, done that. no success. – Alex Rose Apr 26 '13 at 12:45
up vote 0 down vote accepted

You can use a host alias in the sudoers file to specify specic IPs, or subnet ranges ie:

Host_Alias  MAIL =
Host_Alias  FTP =,

bob          FTP = (ALL) NOPASSWD: ALL
share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.