cant add user to sudo group in centOS 7 i386(no GUI,Its minimal)
I don't know why your command doesn't work. It may have to do with either:
- your CentOS not using sudo by default
- the way the sudoers file should be edited
- the syntax of
adduser
command on that particular machine.
Apparently, and it is my guess, it's first of all a matter of the last point.
Anyhow, the easiest way is to add the user to the wheel
group, which should have sudo priviliges on your CentOS. Try out this command:
usermod -aG wheel Smit
This of course has to be done by root
. Once successfully executed, change identity to Smit
and check if you can sudo
.
su - Smit
sudo yum update
As an alternative, you can use visudo
. Adding this line should do:
Smit ALL=(ALL) ALL
But here's a guide with a few more details if you're interested.
You just need to add user Smit to group wheel which is have permission to run all commands with sudo command And you can accomplish it by entering the following command
vim /etc/group
look for wheel group and add smit to it
save and exit and thats it.