Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

On a sandbox VM environment, I have a setup of Ubuntu Linux which is firewalled and cannot be accessed from outside the local system. Therefore, on that VM, I'd like to give the administrative user (which I set up) the ability to run anything with sudo and not need a password.

While I know this is not secure, this VM is not on all the time, and requires my personal passcode to run. So even though this is not "secure", is there a way to get the desired functionality?

share|improve this question

1 Answer 1

up vote 9 down vote accepted

From man sudoers:

   NOPASSWD and PASSWD

   By default, sudo requires that a user authenticate him or herself
   before running a command.  This behavior can be modified via the
   NOPASSWD tag.  Like a Runas_Spec, the NOPASSWD tag sets a default for
   the commands that follow it in the Cmnd_Spec_List.  Conversely, the
   PASSWD tag can be used to reverse things.  For example:

    ray  rushmore = NOPASSWD: /bin/kill, /bin/ls, /usr/bin/lprm

   would allow the user ray to run /bin/kill, /bin/ls, and /usr/bin/lprm
   as root on the machine rushmore without authenticating himself.

One other tag is ALL, to allow the user ray to run any command on any host without password you can use:

ray ALL= NOPASSWD: ALL
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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