Hello,
Thanks for visiting RvKmR.blogspot.in
In this blog post, I am explaining about Wheel users in Linux. Red Hat release that I am working on is as below.
Thanks for visiting RvKmR.blogspot.in
In this blog post, I am explaining about Wheel users in Linux. Red Hat release that I am working on is as below.
[ravi@localhost vagrant]$ cat /etc/redhat-release
CentOS release 6.9 (Final)
CentOS release 6.9 (Final)
An Linux system can have many
users like System users, normal users, and admin (root) user. Its common
sens that we have is not to share root user credentials with other
user, but here is case that we wish to run administrative command by
normal user. In that case we need to aware about wheel users group.
Let's first understand what is wheel user in Linux and why we needed it. Wheel is one of Linux user group that allow members of that group to run administrative commands those need root access of system, Wheel user facilitate to do that with sudo (superuser do ) privileges.
Lets do it on terminal :
Add an user and set password
[root@localhost vagrant]# useradd ravi
[root@localhost vagrant]# passwd ravi
Changing password for user ravi.
New password:
BAD PASSWORD: it is based on a dictionary word
Retype new password:
passwd: all authentication tokens updated successfully.
Changing password for user ravi.
New password:
BAD PASSWORD: it is based on a dictionary word
Retype new password:
passwd: all authentication tokens updated successfully.
[root@localhost vagrant]# id ravi
uid=501(ravi) gid=501(ravi) groups=501(ravi)
uid=501(ravi) gid=501(ravi) groups=501(ravi)
As you can see above we have created user "ravi " and we can verify that with "id " command. we also seen that user "ravi" is part of primary group "ravi". As mentioned above we need to add user "ravi" to wheel user group. lets do that on terminal.
Run command "visudo" to edit sudoers file and locate below lines. uncomment second line from below two lines and save.
## Allows people in group wheel to run all commands
# %wheel ALL=(ALL) ALL
# %wheel ALL=(ALL) ALL
Above line looks as below now after uncommenting:
## Allows people in group wheel to run all commands
%wheel ALL=(ALL) ALL
Now add user "ravi" to sudoers group :
[root@localhost vagrant]# usermod -aG wheel ravi
Verify our configuration working fine or not
[root@localhost vagrant]# id ravi
uid=501(ravi) gid=501(ravi) groups=501(ravi),10(wheel)
uid=501(ravi) gid=501(ravi) groups=501(ravi),10(wheel)
[root@localhost vagrant]# su ravi
[ravi@localhost vagrant]$ sudo yum update
[sudo] password for ravi:
Loaded plugins: fastestmirror
Setting up Update Process
Loading mirror speeds from cached hostfile
* base: mirrors.vhost.vn
* extras: mirrors.vhost.vn
* updates: mirrors.vhost.vn
base | 3.7 kB 00:00
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
No Packages marked for Update
[ravi@localhost vagrant]$ sudo yum update
[sudo] password for ravi:
Loaded plugins: fastestmirror
Setting up Update Process
Loading mirror speeds from cached hostfile
* base: mirrors.vhost.vn
* extras: mirrors.vhost.vn
* updates: mirrors.vhost.vn
base | 3.7 kB 00:00
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
No Packages marked for Update
Yes !! it worked fine.
Comments
Post a Comment