LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   configure /etc/sudoers for passwords (https://www.linuxquestions.org/questions/linux-security-4/configure-etc-sudoers-for-passwords-720388/)

stormcloud 04-20-2009 06:20 AM

configure /etc/sudoers for passwords
 
Hi,

One of my (most trusted) users will need to become root to run a set of maintenance tasks over the next few weeks. Rather then give away the root password I'd like to be able to run a bash shell through sudo.

I've edited the /etc/sudoers with the following extra line:


User1 ALL=/bin/bash


The problem is that we can now run bash as root WITHOUT typing is a password.

I thought the default was the opposite way round; the user would have to enter the password unless I add the "NOPASSWD: ALL" flag to the end of the line.

Any ideas what I'm doing wrong?

AlucardZero 04-20-2009 09:00 AM

Quote:

can now run bash as root
Are you running the sudo command as root or as User1? root will not be prompted for a password. User1 should.

You may try:
Code:

User1 ALL=PASSWD: /bin/bash
or to grant him everything:
Code:

User1 ALL=(ALL) ALL

fpmurphy 04-20-2009 09:03 AM

Try placing this line before any lines that contain NOPASSWD

stormcloud 04-21-2009 02:40 AM

Hi,

I've made the changes you both suggest and it now works perfectly.

Thanks :^)


All times are GMT -5. The time now is 02:52 PM.