0

I'm trying to give a specific user the ability to run two commands w/ sudo, without prompting for a password. This is what I did:

# temporarily grant privs to nitsadmin
Cmnd_Alias REBOOT = /usr/sbin/reboot
Cmnd_Alias STOP_START_CRUSHFTP = /var/opt/Crushftp/crushftp_init.sh

nitsadmin ALL=(ALL) NOPASSWD: STOP_START_CRUSHFTP, REBOOT

The reboot command works exactly as expected, but the crushftp_init.sh command insists on prompting for a password.

Help?

In repy to first comment, this is what I see:

nitsadmin@dropbox:~$ sudo /var/opt/CrushFTP10/crushftp_init.sh stop
[sudo] password for nitsadmin: 

So I'm pretty sure it's sudo that is prompting for a password.

3
  • 1
    When you are prompted for a password? Does it prompt for a sudo password? What in included in /var/opt/Crushftp/crushftp_init.sh? Are there any lines in that which prompt for a password?
    – Randomhero
    Commented Sep 16, 2021 at 15:40
  • Updated the post with anwer to your question. Commented Sep 16, 2021 at 15:58
  • Did my answer help you out at all?
    – Randomhero
    Commented Sep 30, 2021 at 10:10

1 Answer 1

1

You may need to change:

Cmnd_Alias STOP_START_CRUSHFTP = /var/opt/Crushftp/crushftp_init.sh

to:

Cmnd_Alias STOP_START_CRUSHFTP = /var/opt/Crushftp/crushftp_init.sh*

The alias in the sudoers file needs to match exactly how the command will be run. So /var/opt/Crushftp/crushftp_init.sh does not match /var/opt/Crushftp/crushftp_init.sh install

EDIT: This will allow any variation of /var/opt/Crushftp/crushftp_init.sh to be run with sudo without a password. You can change your alias to Cmnd_Alias STOP_START_CRUSHFTP = /var/opt/Crushftp/crushftp_init.sh stop if you want to limit to only stop etc.

1
  • 1
    Tht did it, thanks! I actually had a typo on the pthme of the script, so I corrected that too. All good now, thanks! Commented Oct 4, 2021 at 15:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .