Sudo command configs


 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Sudo command configs
# 1  
Old 10-28-2011
Sudo command configs

I am wondering how to use SUDO command to allow only my account to run mount command as root. I have root privilege.Smilie
# 2  
Old 10-28-2011
Code:
man sudoers

This User Gave Thanks to yazu For This Post:
# 3  
Old 10-29-2011
I did, but couldn't figure out! and since I don't want to play around with sudo, asked my question here...
Thanks for reply
# 4  
Old 10-29-2011
This User Gave Thanks to dude2cool For This Post:
# 5  
Old 10-30-2011
To fine grain your goal, you need to create several groups depending on the roles. Like you can create a group "idadmins" which will contain the users who work on access controls and user administration.

Code:
groupadd idadmins
gpasswd -M adm01,adm02,adm03 idadmins

Next, create a command alias in /etc/sudoers file with all of the commands that would need root privilege and has to be used by the members of idadmins group. Something like this:
Code:
Cmnd_Alias USRADMN = /usr/sbin/useradd, /usr/sbin/usermod

Now, add a line like the below to delegate the idadmins group permission to execute the commands in USRADMN command alias as root.

Code:
# user/group     machine=commands/command_alias
%idadmins       ALL=USRADMN

In this way, you do not have to rework on /etc/sudoers file while adding a new user admin; just add him/her to the idadmins group and that's it. Also, as you are defining exactly what commands they can use with sudo, yu are restricting them from using any other command with sudo which requires root privilege, e.g: mount (although, just the mount command does not require root privileges on most UNIX systems; that's just to show what filesystems are mounted presently). Hope this helps!! Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Expect script to show cisco configs

I know there are better ways to do this. I prefer snmp. I do not have the proper perl modules loaded on the platorm. Snmp isnt loaded on the platform. Telnet is not an option. I need to write an expect script to pull cisco equipment configs. The following code is executed once I gain... (0 Replies)
Discussion started by: popeye
0 Replies

2. Linux

Packages that monitor OS configs and service/ports?

I have several Redhat servers and workstations that I need to be able to monitor for any changes and be notified of any changes to the OS. The features I need to specifically monitor are: ports - opening of new ports that are not already in a whitelist services - any starting or attempts to start... (1 Reply)
Discussion started by: JCDinPGH
1 Replies

3. Shell Programming and Scripting

ssh foo.com sudo command - Prompts for sudo password as visible text. Help?

I am writing a BASH script to update a webserver and then restart Apache. It looks basically like this: #!/bin/bash rsync /path/on/local/machine/ foo.com:path/on/remote/machine/ ssh foo.com sudo /etc/init.d/apache2 reloadrsync and ssh don't prompt for a password, because I have DSA encryption... (9 Replies)
Discussion started by: fluoborate
9 Replies

4. Shell Programming and Scripting

loop through configs

hi All, is there a way in linux to loop thru all variables sourced? i have a set configs like A=100 b=200 c=400 i can add the above lines to a file and source - so that $A will be 100 .. like wise now when i do a cut -c 1-2 file.txt |sort | uniq -c on a file it returns me A 100 B 50 c... (1 Reply)
Discussion started by: arun1401
1 Replies

5. UNIX for Dummies Questions & Answers

VI - in need of configs/scripts

Hi, I'm somewhat new to unix OS and I'm at course for programmers in my country. and in the course we learn unix and how to script in unix. of course we just started and we learned only the very basic, but I'm a really computer freak and I looking for a way to make the course easier on all of... (8 Replies)
Discussion started by: Bonzay0
8 Replies

6. Infrastructure Monitoring

Script to sort Cisco configs

Hi everyone :), I need sort Cisco configs to report but i cannot do the script to made this: #### INPUT ##### config-register 0x2102 version 12.2 ! hostname Router ! interface Ethernet0 description Red LAN ip address 192.168.1.1 255.255.255.0 no cdp enable ! interface Serial0... (6 Replies)
Discussion started by: azrael75
6 Replies

7. UNIX for Dummies Questions & Answers

Unable to use the Sudo command. "0509-130 Symbol resolution failed for sudo because:"

Hi! I'm very new to unix, so please keep that in mind with the level of language used if you choose to help :D Thanks! When attempting to use sudo on and AIX machine with oslevel 5.1.0.0, I get the following error: exec(): 0509-036 Cannot load program sudo because of the following errors:... (1 Reply)
Discussion started by: Chloe123
1 Replies

8. UNIX for Advanced & Expert Users

Sudo command

Hello, What does the below sudo command provide access to, does it allow a user to su to any other user except root. sudo !/usr/bin/su * (1 Reply)
Discussion started by: sophos
1 Replies

9. Solaris

Sudo for a command

I am trying to set up sudo for a command, but do not want to specify the arguments that can be passed into it. I want the user who is using sudo to be able to pass in the arguments they want. I am fairly sure I know how to do this with RBAC in Solaris 10, but for reasons I will not get into I... (1 Reply)
Discussion started by: synchro
1 Replies

10. UNIX for Dummies Questions & Answers

mail configs and linux suse 9

Hello, I am needing to find what smtp server we are using on our linux box that run suse 9 when ever we mail out from the box using the mail command.... I have searched the board and see references to sendmail.cf but can't find this file on our box... I see alot of mail configs in /etc/postfix... (2 Replies)
Discussion started by: benefactr
2 Replies
Login or Register to Ask a Question