sudo su without password – ubuntu, centos

Tired of hitting root user passwords ?! Don’t worry, you can login in as root user without password by using sudo su. This is applicable for most of the linux distributions, but I have tested with Ubuntu and Centos here and worked.

sudo su without password


Login as root user and open /etc/sudoers file, add the below lines

The /etc/sudoers file allows listed users access to execute a subset of commands while having the privileges of the root user.

vi /etc/sudoers

sathish   ALL = (ALL)  NOPASSWD: ALL

Here replace “sathish” with your username


sudo su without password

save and quit the file (Esc + :wq!). Then logout and relogin as root user “sudo su”, Now the shell will not prompt password.

sudo su without password

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)

Add a Comment

Your email address will not be published. Required fields are marked *