/etc/sudoers - extract Ids


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting /etc/sudoers - extract Ids
# 1  
Old 09-13-2010
MySQL /etc/sudoers - extract Ids

Gurus

I have an unusual task to be done with.

Task:

A > Pick up /etc/sudoers file and extract all the Ids from it.

B > Compare these Ids with those in /etc/passwd file .If match is found,store those Ids in a separate file.

O.S involved : Solaris 5.9/5.10 , AIX 5.1/5.2/5.3


Part B is relatively simple and can be handled later.

I need advice/help on Part A.

Any direction is highly appreciated !!

Regards
AbHi
# 2  
Old 09-13-2010
Does it have to work in all cases? Otherwise, it can be a difficult parse... there are lots of variations and aliasing, etc.
# 3  
Old 09-14-2010
MySQL

@ cjcox:

what approach are you suggesting?

i know its going to be a very difficult parse and i am already struggling with it.

all cases ?? i could not get that....


AbHi
# 4  
Old 09-14-2010
My point is that you can have more than one User_Alias in the file. You could have authorizations by group and/or netgroup and/or other. And of course you could have just plain old usernames. There's a LOT of variables to parsing all of that.
# 5  
Old 09-15-2010
Bug

all cases...yes

take the most complex sudoers file you have .... Smilie


its a big task


regards
aBhI
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

List of all ids,groups, privilege ids

I wish to pull out a list of all user ids on the system, including the privileged ids, the groups to which they belong to. Sometimes after deleting an id also, its home dir does not get deleted or an entry is left behind in /etc/passwd. Can someone help me with a script to achieve both. (2 Replies)
Discussion started by: ggayathri
2 Replies

2. Solaris

Sudoers

Having a bit of a discussion with a software vendor about this. Can anyone confirm my understanding? /etc/sudoers file example:- user1 server1 = NOPASSWD:/usr/bin/ls -l user1 server1 = NOPASSWD:/usr/bin/file But then the following command fails (logged in on server 1 as user1) because... (2 Replies)
Discussion started by: psychocandy
2 Replies

3. Linux

Sudoers in Centos

In our servers we don't have proper groups and No active Directory. We are adding Users locally and providing users a public key, that's the way they can connect to the servers using .ppk file. My manager ask me to prompt for a password based login when they try for Sudo. (Currently it was set... (1 Reply)
Discussion started by: shekar777
1 Replies

4. UNIX for Dummies Questions & Answers

Extract columns by matching ids in two files

Hello, I want to extract columns from file2 to file3 by matching ids between file1 and file2. The extracted columns should be in same order as file1 ids. for example: file1.txt 1823 607 R2A9 802 771 file2.txt 1823 1 2 4 22 11 4 29 607 12 3 3 R2A9... (8 Replies)
Discussion started by: ryan9011
8 Replies

5. Solaris

sudoers

what is the configuration file for sudo? can we edit it as like other file or will it create any adverse effect on editing that file? thanks in advance dinu (1 Reply)
Discussion started by: dinu
1 Replies

6. Solaris

sudoers

this is for the first time i am going to use sudoers i want know how to create sudoers and giving privileges for that users thanks in advance dinu (6 Replies)
Discussion started by: dinu
6 Replies

7. UNIX for Advanced & Expert Users

sudoers file

i have defined a rule in the sudoers file so a specific user is able to run some commands as sudo with no password. my question is: is it possible to restrict a user to run commands as sudo only in a certain directory? for example: chown only the files that are located in /var/tmp. Thank you. ... (2 Replies)
Discussion started by: noam128
2 Replies

8. UNIX for Dummies Questions & Answers

sudoers

i just installed/configured apache2.0 on my own aix5.3 mini server. i can start/stop apache by root, but i want to start it under my login id(admin) instead. i need to execute this command: /usr/bin/sudo /usr/IBM/HTTPServer/bin/apachectl stop/start. (5 Replies)
Discussion started by: tjmannonline
5 Replies

9. UNIX for Dummies Questions & Answers

sudoers on HP 11.11

Having a "running low on coffee" moment here & need help. On HP 11.11 where is the sudoers file located; I looked every place I could think of and don't see it. Thanks in advance:confused: (2 Replies)
Discussion started by: dhlopomo
2 Replies

10. Linux

sudoers file

Hi, I have edited 'sudoers' file to allow 'cads' user shutdown the system without providing a password. Can someone tell me what's wrong with my file? It's not working when I 'sudo SHUTDOWN' command: sudo: SHUTDOWN: command not found Thanks a lot! # Host alias specification... (4 Replies)
Discussion started by: whatisthis
4 Replies
Login or Register to Ask a Question