LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-30-2013, 03:33 AM   #1
devUnix
Member
 
Registered: Oct 2010
Posts: 606

Rep: Reputation: 59
Listing sudo commands assigned to a group


I want to list the sudo permissions of / commands allowed to be executed by all the members of a given group, but this one is not working:


Code:
# sudo -l -g Production-Support.GG
usage: sudo -h | -K | -k | -L | -V
usage: sudo -v [-AknS] [-p prompt]
usage: sudo -l[l] [-AknS] [-g groupname|#gid] [-p prompt] [-U username] [-u username|#uid] [-g groupname|#gid]
            [command]
usage: sudo [-AbEHknPS] [-r role] [-t type] [-C fd] [-g groupname|#gid] [-p prompt] [-u username|#uid] [-g
            groupname|#gid] [VAR=value] [-i|-s] [<command>]
usage: sudo -e [-AknS] [-r role] [-t type] [-C fd] [-g groupname|#gid] [-p prompt] [-u username|#uid] file ...
I used the GID in place of the group name but still I the same usage message as shown above.

I can however list the sudo commands assigned to a user:


Code:
# sudo -l -U Jack
Matching Defaults entries for Jack on this host:
    env_reset, env_keep="COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR LS_COLORS MAIL PS1 PS2 QTDIR USERNAME LANG
    LC_ADDRESS LC_CTYPE LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC
    LC_PAPER LC_TELEPHONE LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY"

User Jack may run the following commands on this host:
    (root) NOPASSWD: /bin/ls
    (root) NOPASSWD: /bin/view
How do I do the same thing for a group?
 
Old 08-30-2013, 03:49 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
There is no option available for what you want/need.

-U (in combination with -l) does this for users.

The -u and -g options are there to run commands as a different user then root (have a look at the sudo manual page).

There is no -G option.
 
Old 08-30-2013, 04:16 AM   #3
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
Code:
sudo grep "%Production-Support.GG" /etc/sudoers* -r
but Jack can't run that... Yet..

Code:
sudo view
# assuming it is vi/vim
:!bash # or some other shell
# you now have full root
grep "%Production-Support.GG" /etc/sudoers* -r
Fix the 'exploit', in sudoers..
Code:
Jack ALL=(root) NOPASSWD: NOEXEC: /usr/bin/view
but still, since Jack can edit any file as root, they can remove NOEXEC: and get full root again.

Last edited by Firerat; 08-30-2013 at 04:29 AM. Reason: sudo view, or no root :)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to view user admins assigned in a group mystique Linux - Newbie 2 11-29-2010 10:20 PM
What group is my user ID assigned to? runnerpaul Solaris / OpenSolaris 2 09-26-2008 06:47 AM
permissions not recognizing group or assigned users to group blckspder Linux - Server 1 07-28-2008 10:32 AM
ID created with assigned group is not display in /etc/group file dwarf007 Linux - Security 2 08-21-2007 10:39 PM
multiple commands assigned to bash variable itzamecwp Linux - Newbie 3 02-14-2007 06:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration