Tuesday 7 June 2011

Sudo


Sudo

            Super User Do. The command SUDO permit a user with proper permission to execute the command as the Super User or other user the file /etc/sudoers control the SUDO access, editor and syntax checker.
# vi sudo ß fired for edit the file of SUDO configuration sudo is easy to configure.

1. For allow all root permissions to Sudo user.
# vi /etc/sudoers
:se nu                                             = Go to line no 78 and add users after root.
            76 root, nilesh    ALL=(ALL)       ALL
            :wq!

# su – nilesh
[nilesh@host ~]$ sudo su –                   =Enter user password.

2. For allow fire specified command to Sudo users.
# vi /etc/sudoers
:se nu              = Go to line no 20 copy(yy) it and paste(p) below this line
and create user alias.
            20 # User_Alias ADMINS = jsmith, mikem
21 User_Alias USER = nilesh
Bellow line no 24 add a new line and create command alias.
24 ## Command Aliases
25 Cmnd_Alias CMD = /usr/sbin/useradd, /usr/bin/passwd
Esc
:$                                           = For go to end of this file write in a new line for set value.
            97 USER ALL=CMD
:wq!
After that the nilesh user can able to run useradd and passwd commands.

# su – nilesh
[nilesh@host ~]$ sudo /usr/sbin/useradd kumar
[nilesh@host ~]$ sudo /usr/bin/passwd kumar

No comments:

Post a Comment

Boot to UEFI Mode or legacy BIOS mode

Boot to UEFI Mode or legacy BIOS mode Choose UEFI or legacy BIOS modes while installing Windows. After Windows is installed, if you nee...