How to autologin as a superuser

Mostafa Z. Afgani mostafa.afgani at
Mon Dec 5 09:28:13 UTC 2005


> 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


More information about the fedora-list mailing list