How to autologin as a superuser

Mostafa Z. Afgani mostafa.afgani at world.iu-bremen.de
Mon Dec 5 09:28:13 UTC 2005


THUFIR HAWAT wrote:

> I'm not clear on how sudo works.  Rather than typing "su -" followed
> by root's password, can I set it up so that I just type "sudo" and
> then I *am* root until I exit?

Well, as other people have pointed out, there are many security issues. 
But there is a way to do exactly what you want:

1. Run 'visudo' as root

2. append the following below the "root   ALL=(ALL)   ALL" line:
	your_user_name  ALL = NOPASSWD: /bin/su

3. Save and exit vi

Now, you can just type 'sudo su -' and you'll get a root shell. Of 
course, it's a good idea to do a 'man sudoers' first!

> Thanks,
> 
> Thufir
> 

Best,
-M




More information about the users mailing list