Discussion:
[Freeipa-users] sudo NOPASSWD for a single command
Auerbach, Steven
2017-02-22 16:38:50 UTC
Permalink
We have a script stored on a particular server in our realm that executes a number of non-privileged commands and are wanting to add /sbin/vgs command. The script uses SSH to then execute the same set of commands on all the servers in the realm.

The owner of the script is in the administrator group and there are sudoer commands for the administrator group in general. We need to place a rule for this one command for either this group or the script owner to run NOPASSWD.

Where and how would I specify that in the IPA admin console?

Steven Auerbach
Systems Administrator

State University System of Florida
Board of Governors
325 W. Gaines Street, Suite 1625
Tallahassee, Florida 32399
(850) 245-9592
***@flbog.edu<mailto:***@flbog.edu> | www.flbog.edu<http://www.flbog.edu/>
[email_sig]
Jason B. Nance
2017-02-22 16:58:35 UTC
Permalink
Post by Auerbach, Steven
We have a script stored on a particular server in our realm that executes a
number of non-privileged commands and are wanting to add /sbin/vgs command. The
script uses SSH to then execute the same set of commands on all the servers in
the realm.
The owner of the script is in the administrator group and there are sudoer
commands for the administrator group in general. We need to place a rule for
this one command for either this group or the script owner to run NOPASSWD.
Where and how would I specify that in the IPA admin console?
Have you tried creating your command in IPA as "NOPASSWD: /sbin/vgs" (Policy -> Sudo -> Sudo Commands)?
Auerbach, Steven
2017-02-23 14:43:44 UTC
Permalink
Yes, I implemented in Policy -> Sudo -> Sudo Commands as:
Sudo Command: NOPASSWD: /sbin/vgs

The script (executed by a non-root, administrative group user on an enrolled host) specifies:

.
hostname >> statresults.txt
cat /etc/redhat-release >> statresults.txt
uname -r >> statresults.txt
printf "\n " >> statresults.txt
sudo vgs >> statresults.txt

..
Running the script I still was prompted for a password. So I guess this does not work.

From: Jason B. Nance [mailto:***@tresgeek.net]
Sent: Wednesday, February 22, 2017 11:59 AM
To: Auerbach, Steven <***@flbog.edu>
Cc: freeipa-***@redhat.com
Subject: Re: [Freeipa-users] sudo NOPASSWD for a single command


We have a script stored on a particular server in our realm that executes a number of non-privileged commands and are wanting to add /sbin/vgs command. The script uses SSH to then execute the same set of commands on all the servers in the realm.
The owner of the script is in the administrator group and there are sudoer commands for the administrator group in general. We need to place a rule for this one command for either this group or the script owner to run NOPASSWD.
Where and how would I specify that in the IPA admin console?
Have you tried creating your command in IPA as "NOPASSWD: /sbin/vgs" (Policy -> Sudo -> Sudo Commands)?
Brendan Kearney
2017-02-23 14:53:07 UTC
Permalink
Post by Auerbach, Steven
sudo vgs >> statresults.txt
should be sudo /sbin/vgs >> statresults.txt since that is what sudo
allows. its almost like exact match for strings.
Pavel Březina
2017-02-24 08:21:00 UTC
Permalink
Post by Auerbach, Steven
Sudo Command: NOPASSWD: /sbin/vgs
NOPASSWD is used in /etc/sudoers. In IPA, create a sudo option
"!authenticate" instead.
Post by Auerbach, Steven
The script (executed by a non-root, administrative group user on an
….
hostname >> statresults.txt
cat /etc/redhat-release >> statresults.txt
uname -r >> statresults.txt
printf "\n " >> statresults.txt
sudo vgs >> statresults.txt
…..
Running the script I still was prompted for a password. So I guess this does not work.
*Sent:* Wednesday, February 22, 2017 11:59 AM
*Subject:* Re: [Freeipa-users] sudo NOPASSWD for a single command
We have a script stored on a particular server in our realm that
executes a number of non-privileged commands and are wanting to add
/sbin/vgs command. The script uses SSH to then execute the same set
of commands on all the servers in the realm.
The owner of the script is in the administrator group and there are
sudoer commands for the administrator group in general. We need to
place a rule for this one command for either this group or the
script owner to run NOPASSWD.
Where and how would I specify that in the IPA admin console?
Have you tried creating your command in IPA as "NOPASSWD: /sbin/vgs"
(Policy -> Sudo -> Sudo Commands)?
--
Manage your subscription for the Freeipa-users mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-users
Go to http://freeipa.org for more info on the project
Continue reading on narkive:
Search results for '[Freeipa-users] sudo NOPASSWD for a single command' (Questions and Answers)
6
replies
What is the best server oriented (free) Linux distro?
started 2011-01-04 00:38:25 UTC
computer networking
Loading...