Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to collect information on what sudoers actions a user can perform on a server. From what I've read, you can do this with the command sudo -l -U username. However, one server that I have has a slightly older version of sudo (1.6.7p5) and the -U option doesn't seem to exist (I don't own the server so I can't just upgrade to a newer version of sudo).

Has anyone ever had to collect sudoers information for all users on a server? How would you recommend doing it?

EDIT: This has to be an automated process, so "just look at the sudoers file" won't work.

share|improve this question
    
If you at least have root privileges, you can install a newer sudo to your home directory (./configure --prefix ~/usr or your location of choice), run it with -U, then simply remove it. – grawity Jan 11 '11 at 14:16
    
I don't have root privileges or permission to install a newer sudo. – Jon Kruger Jan 11 '11 at 15:30

You can just do visudo and see what options each user has.

share|improve this answer
    
This has to be an automated process, so just visually looking at the file won't work. – Jon Kruger Jan 11 '11 at 15:29

As root:

cat /etc/sudoers > /home/username/sudoerprivs  
cd /home/username  
chown username:username sudoerprivs
share|improve this answer
    
This has to be an automated process, so just visually looking at the file won't work. – Jon Kruger Jan 11 '11 at 18:25
    
Can't you just search through the file with grep and awk based on the lines you need? – Katerberg Jan 20 '11 at 23:07
1  
@Diablomarcus - yes you could. I made a copy in this method so it could be moved to another computer in an enterprise environment. Then you could launch shell scripts containing grep or awk at a hierarchy of directories/files to programmatically check ALL computers. – RobotHumans Jan 21 '11 at 1:11

You must log in to answer this question.

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