I usually SSH into my Raspberry Pi with the "pi" account. I always have to type my password (every 5 mins) when I want to use sudo. Now I don't have to do that anymore. My sudoers file has the NOPASSWD option enabled, but I'm quite sure I didn't enable it myself.

Since it is a security issue I'm worried about the change in behavior of my system. Should I delete the NOPASSWD option, or is it okay like it is?

  • 1
    First things first, in case you don't know : to edit /etc/sudoers, use visudo. You can't use sudo nano /etc/sudoers.
    – M Noit
    Oct 17, 2013 at 10:35
  • Some other distributions have disabled NOPASSWD. Are you sure it was with the current install. Also, did you change the password to something other than 'raspberry'? Someone might have "hacked" your pi, thought not very likely. If safety is a great concern, you'd have to do a reinstall.
    – Gerben
    Oct 17, 2013 at 16:11
  • When modifying /etc/sudoers, be sure to have another SSH connection with root privileges on the remote system, while trying to gain root privileges on another connection after changing your settings. This will prevent you from locking yourself out of the system if you accidentally mess up your sudoers file.
    – earthmeLon
    Dec 2, 2013 at 21:29

2 Answers 2


If the Pi cannot be access from the internet, and no on else on your network will access the Pi with malicious intent, i'd just leave the NOPASSWD option.
By default, it comes with the NOPASSWD option so unless you removed it, it should never have asked for the password.


The NOPASSWD option makes it so that if you enter sudo as the default Pi account, or any other sudo-capable account with NOPASSWD enabled, you don't have to actually enter your password when running something via sudo. If no-one has access to your account, it is a matter of convenience.

However, should someone get a hold of your Pi and you are logged in, then they can run root commands however, and whenever they want. However, if you are logged out and the person gets your password, the NOPASSWD option doesn't do anything.

Essentially, the NOPASSWD only de-creases security if you manage to lose your Pi, whilst logged in to a sudo-capable account. If someone steals your Pi and manages to crack your password, they

A) Have your Pi (which stinks)
B) Have your password, so NOPASSWD isn't going to change what they do, just how fast they do it.

Personally, I just leave the option on. For me anyways, the Pi is just a testing platform that doesn't have anything of importance on it and is easy to fix any issues people cause. Thus, NOPASSWD is convenient. But it is all personal opinion.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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