Run sudo without entering password

Ubuntu 12.04 (Precise) has taken every possible measure to disable root login from GUI. Though there is a workaround which I posted earlier I was reluctant to login as root after setting up my full environment as a different user. At the same time as a power user I hate providing password each time for running commands using sudo. I am using ext4 filesystem and I have found a solution to this – add the option nouser_xattr in your fstab for the root partition. For example, my fstab entry is:

UUID=015054d2-1052-4635-aca9-4ccdd87af914 /               ext4    noatime,
nodiratime,barrier=0,nobh,commit=20,nouser_xattr,errors=remount-ro 0       1

This will disable the prompt for password every time you run sudo. So you can write a script of commands which need root access (sudo), add the script in the Startup Applications and run it automatically every time after login.

Finally, another way to achieve the same result on any filesystem; add the following at the end of /etc/sudoers file as root:


3 thoughts on “Run sudo without entering password”

Leave a Reply

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