remove sudo passwords

Asked by dale francis

I am running Ubunbtu 10.04 LTS on an ASUS PC eee 900. I would like to be able to determine when to apply passowrds and when not to. The reason I am using Linus is so I can control the environment I operate in. This is the power of Linux. How do I gain control of the password security protection of my computer?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu sudo Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
mycae (mycae) said :
#1

you can modify sudo's behaviour by altering /etc/sudoers . Inside this you will see how to set users to allow root commands to be executed without a password.

I will mention that configuring your system this way is highly insecure, as it will allow any program to increase its own privelige level without your authorisation, at any time -- this could be used as an attack vector for your machine (known as "root privilege escalation"), however you are of course free to configure your system as you see fit.

I recommend using the "visudo" command to do this, as the program will check the syntax of the sudoers file before you quit, as if you get this wrong, you can lock yourself out of the sudo command -- needed to edit sudoers!

Revision history for this message
dale francis (p-dale-p) said :
#2

I ran sudo visudo.
The last line now reads
<username> ALL=NOPASSWD: ALL

I still am asked for passwords on many occasions when I don't think I need one.

One example is I am asked for a keyring password because it is different from the login password. As far as I know they are the same.

A second example is a request for a password during the process of adding a printer. I have tried every password I have and none of them work.

Neither of these are times when I think I need a password, particularly when Iam not sure how to respond successfully.

Revision history for this message
mycae (mycae) said :
#3

You need to change <username> to specify your actual username (assuming it does not), and you need to use the NOPASSWD value.

http://www.ducea.com/2006/06/18/linux-tips-password-usage-in-sudo-passwd-nopasswd/

eg

dale ALL = NOPASSWD: ALL

Revision history for this message
dale francis (p-dale-p) said :
#4

That is what I used.

Revision history for this message
Eliah Kagan (degeneracypressure) said :
#5

You might also be asked for a password to log in to Launchpad, or to your email account, or to connect to someone else's computer. There are many different sorts of tasks where you might be asked for a password. While you have successfully eliminated the need to enter your password for sudo, you will have to make other configuration changes to eliminate passwords elsewhere.

The keyring protects access to data that is encrypted with its password. If there is no keyring password, then keyring-stored data are not encrypted, and can be lifted from your computer by anyone who gains access to your account or to its disk (e.g., if someone steals it), rapidly and with trivial ease. If you are willing to accept that risk, then just change your keyring password to be the blank password. Then you won't be asked for a password anymore to unlock keyring-"protected" data. (If you don't know your keyring password, then you'll have to reset it, losing your keyring-protected data.)

"A second example is a request for a password during the process of adding a printer."

That is strange. Is it a network printer? Perhaps you are being asked for the password to the computer to which the printer is connected. If this is a USB printer connected directly to your computer, then this should be your administrative password. My first thought was that perhaps you have made it so that you don't need to enter passwords for sudo/gksu/gksudo but do still need to enter your password for PolicyKit, but if that were the case then you'd probably have more widespread examples of situations where you are still prompted for your password to perform administrative tasks.

If the above information does not enable you to solve your problem, please feel free to post another reply so work on the problem of how to eliminate passwords where you do not want them can continue. (If this does solve your problem, then please mark this question as Solved, which you can do at https://answers.launchpad.net/ubuntu/+source/sudo/+question/175672.)

Can you help with this problem?

Provide an answer of your own, or ask dale francis for more information if necessary.

To post a message you must log in.