* Sudo allows a system administrator to delegate authority to give certain users or groups of users the ability to run some or all commands as root .
* super user with unrestricted access to all system resources and files in Linux is the user named root.
* sudo has a user ID, of 0 which is universally identified by Linux applications .
* You will need to log in as user root to add new users to your Linux server.
Creating Super user
> Add the user vinod
> suppose i {root} wanna give authority to vinod to run fdisk command, i will need to find the path of fdisk by following command
# whereis fdisk
> Open the sudo configuration file
# visudo
>Now go down at the root prompt, and put this entry
vinod ALL(ALL) /sbin/fdisk <-- its the path of fdisk command
Note: If you wanna vinod to have all authorities of root user, then put ALL at the place of /sbin/fdisk
> save and exit the file
> Login by user vinod
$ sudo /sbin/fdisk -l
> Give password of your own
> Now if you wanna run any command, then you have find its path first and then run the command with the path
>Suppose i need to run partprobe command , then i will do something like this:-
# whereis partprobe
# sudo /sbin/partprobe /dev/sda5
No comments:
Post a Comment