cant add user to sudo group in centOS 7 i386(no GUI,Its minimal)
I had install centOS 7 minimal version in my virtualbox in Ubuntu mate. It has no GUI. It is totally CLI. My user name is Smit
and able to login in to it. But when i type command
sudo yum update
and enter my password, it says
Smit is not in sudoers files. This incident will be reported.
But when I try to add my user to sudo
group by command
adduser Smit sudo
gives something like this:
(I am unable to copy-paste via virtual-box. I do this by login in root.)
centos command-line sudo users privileges
add a comment |
I had install centOS 7 minimal version in my virtualbox in Ubuntu mate. It has no GUI. It is totally CLI. My user name is Smit
and able to login in to it. But when i type command
sudo yum update
and enter my password, it says
Smit is not in sudoers files. This incident will be reported.
But when I try to add my user to sudo
group by command
adduser Smit sudo
gives something like this:
(I am unable to copy-paste via virtual-box. I do this by login in root.)
centos command-line sudo users privileges
i had used the command in both manner.without<>
and with<>
– noone
Jun 10 '17 at 18:12
add a comment |
I had install centOS 7 minimal version in my virtualbox in Ubuntu mate. It has no GUI. It is totally CLI. My user name is Smit
and able to login in to it. But when i type command
sudo yum update
and enter my password, it says
Smit is not in sudoers files. This incident will be reported.
But when I try to add my user to sudo
group by command
adduser Smit sudo
gives something like this:
(I am unable to copy-paste via virtual-box. I do this by login in root.)
centos command-line sudo users privileges
I had install centOS 7 minimal version in my virtualbox in Ubuntu mate. It has no GUI. It is totally CLI. My user name is Smit
and able to login in to it. But when i type command
sudo yum update
and enter my password, it says
Smit is not in sudoers files. This incident will be reported.
But when I try to add my user to sudo
group by command
adduser Smit sudo
gives something like this:
(I am unable to copy-paste via virtual-box. I do this by login in root.)
centos command-line sudo users privileges
centos command-line sudo users privileges
edited Jun 10 '17 at 19:17
Tomasz
9,38852965
9,38852965
asked Jun 10 '17 at 17:57
noonenoone
14918
14918
i had used the command in both manner.without<>
and with<>
– noone
Jun 10 '17 at 18:12
add a comment |
i had used the command in both manner.without<>
and with<>
– noone
Jun 10 '17 at 18:12
i had used the command in both manner.without
<>
and with <>
– noone
Jun 10 '17 at 18:12
i had used the command in both manner.without
<>
and with <>
– noone
Jun 10 '17 at 18:12
add a comment |
3 Answers
3
active
oldest
votes
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.
add a comment |
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.
add a comment |
I've run into the exact same situation with OP. Tried the same command and got the same result.
Then I used
usermod -aG sudo Smit
and got the result
The group "sudo" does not exist.
I think that is the reason adduser Smit sudo
dose not work -- The group "sudo" does not exist yet!
The following command to add the user to the "wheel" group does work.
usermod -aG wheel Smit
But at this point, switching to user Smit and trying sudo still failed! I have to do one more thing. Use visudo
to open and edit the /etc/sudoers file. Make sure that the line that starts with %wheel is not commented. It should look exactly like this:
## Allows people in group wheel to run all commands
%wheel ALL=(ALL) ALL
That is the final step to set up set up the account and now everything is OK.
New contributor
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f370400%2fcant-add-user-to-sudo-group-in-centos-7-i386no-gui-its-minimal%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
add a comment |
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.
add a comment |
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.
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.
answered Jun 10 '17 at 19:12
TomaszTomasz
9,38852965
9,38852965
add a comment |
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
answered Jun 10 '17 at 23:23
Blacky BirdBlacky Bird
1012
1012
add a comment |
add a comment |
I've run into the exact same situation with OP. Tried the same command and got the same result.
Then I used
usermod -aG sudo Smit
and got the result
The group "sudo" does not exist.
I think that is the reason adduser Smit sudo
dose not work -- The group "sudo" does not exist yet!
The following command to add the user to the "wheel" group does work.
usermod -aG wheel Smit
But at this point, switching to user Smit and trying sudo still failed! I have to do one more thing. Use visudo
to open and edit the /etc/sudoers file. Make sure that the line that starts with %wheel is not commented. It should look exactly like this:
## Allows people in group wheel to run all commands
%wheel ALL=(ALL) ALL
That is the final step to set up set up the account and now everything is OK.
New contributor
add a comment |
I've run into the exact same situation with OP. Tried the same command and got the same result.
Then I used
usermod -aG sudo Smit
and got the result
The group "sudo" does not exist.
I think that is the reason adduser Smit sudo
dose not work -- The group "sudo" does not exist yet!
The following command to add the user to the "wheel" group does work.
usermod -aG wheel Smit
But at this point, switching to user Smit and trying sudo still failed! I have to do one more thing. Use visudo
to open and edit the /etc/sudoers file. Make sure that the line that starts with %wheel is not commented. It should look exactly like this:
## Allows people in group wheel to run all commands
%wheel ALL=(ALL) ALL
That is the final step to set up set up the account and now everything is OK.
New contributor
add a comment |
I've run into the exact same situation with OP. Tried the same command and got the same result.
Then I used
usermod -aG sudo Smit
and got the result
The group "sudo" does not exist.
I think that is the reason adduser Smit sudo
dose not work -- The group "sudo" does not exist yet!
The following command to add the user to the "wheel" group does work.
usermod -aG wheel Smit
But at this point, switching to user Smit and trying sudo still failed! I have to do one more thing. Use visudo
to open and edit the /etc/sudoers file. Make sure that the line that starts with %wheel is not commented. It should look exactly like this:
## Allows people in group wheel to run all commands
%wheel ALL=(ALL) ALL
That is the final step to set up set up the account and now everything is OK.
New contributor
I've run into the exact same situation with OP. Tried the same command and got the same result.
Then I used
usermod -aG sudo Smit
and got the result
The group "sudo" does not exist.
I think that is the reason adduser Smit sudo
dose not work -- The group "sudo" does not exist yet!
The following command to add the user to the "wheel" group does work.
usermod -aG wheel Smit
But at this point, switching to user Smit and trying sudo still failed! I have to do one more thing. Use visudo
to open and edit the /etc/sudoers file. Make sure that the line that starts with %wheel is not commented. It should look exactly like this:
## Allows people in group wheel to run all commands
%wheel ALL=(ALL) ALL
That is the final step to set up set up the account and now everything is OK.
New contributor
New contributor
answered 22 mins ago
BettyBetty
1011
1011
New contributor
New contributor
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f370400%2fcant-add-user-to-sudo-group-in-centos-7-i386no-gui-its-minimal%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
i had used the command in both manner.without
<>
and with<>
– noone
Jun 10 '17 at 18:12