Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to setup sudo without no password but still I get prompted for password, I'm using ubuntu, here is the relevant line from the sudoers configuration file :

share|improve this question
cough Allowing a user to sudo without a password cough. UNSECURE! You should not do this. – Thomas Ward Jul 26 '12 at 16:01
You can do this, but it breaks the security model. Are you absolutely sure you want to do this? – Paddy Landau Jul 26 '12 at 16:26
I can understand wanting to do this on a computer, say at home in a secure situation. Security forces a "good" password, which usually means long and harder to type. Trouble is, we have to type it in VERY regularly and it gets to be tiresome. I am not advocating against security, but, especially in the home situation, it may well be desirable to do this. – Jazz Jul 26 '12 at 22:44
To say this "breaks the security model" is rather extreme. sudo is designed to facilitate passwordless operation easily and even has ready-to-go commented configuration lines in /etc/sudoers to allow a whole group of users to run any command as root without being prompted for a password. There are some adverse security implications of doing this--any program can perform actions as root without you being notified!--but an actual attacker, with the ability to run programs as (non-root) you, can already capture your password as you enter it for sudo (and then run sudo with it). – Eliah Kagan Jul 27 '12 at 17:43
I was wanting to do this just for my ansible ci/cd user.. so that my management scripts can run unattended as part of my CI/CD process. I wouldn't say that's inherently insecure as it's for one user and only via ssh with a private/public key pair. – Tracker1 Jul 10 '14 at 21:16

I believe the correct line is:


Put it in the end of the file - replace gandalf with the appropriate username. (To edit the file, run the command sudo visudo.)

share|improve this answer
Thanks, putting it at the end of the file fixed it for me – trinth Dec 19 '13 at 17:26
Not working for me in ubuntu 16.04 – Praytic Jul 3 at 14:43
You have to log out and in again @Praytic – LnxSlck Jul 7 at 22:05
Still nothing. Strange, because in 14.04 I had no problems with this approach. – Praytic Jul 10 at 10:44

I use the sudo group and have:

share|improve this answer

There is one note to mention. That line should be at end of the /etc/sudoers file.

Why: because some configuration lines from /etc/sudoers overwrite our line.


share|improve this answer

protected by Community Jun 17 '13 at 6:06

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.