PDA

View Full Version : not in the sudoers file, incident will be reported?



gutsknucklebone
18th November 2017, 05:34 AM
Every time I try to use the sudo command I get the message "gk is not in the sudoers file, this incident will be reported." Any suggestions?

ozjd
18th November 2017, 06:58 AM
I guess you didn't set it up during installation. All you need to do is add yourself to the wheel group. The command is su -c "usermod -g wheel username"

gutsknucklebone
18th November 2017, 08:41 PM
I guess you didn't set it up during installation. All you need to do is add yourself to the wheel group. The command is su -c "usermod -g wheel username"

No I definitely did set it up during installation, and it makes me log in. Also, it starts terminal command with the heading [time gk ~]$ so it's definitely set up.

srakitnican
18th November 2017, 08:52 PM
What ozjd meant, you probably did not set your user as administrative account. Just add your user to wheel group as said and re-log.

gutsknucklebone
18th November 2017, 09:10 PM
What ozjd meant, you probably did not set your user as administrative account. Just add your user to wheel group as said and re-log.

OK, I did it and got usermod: no changes

marko
18th November 2017, 11:36 PM
OK, I did it and got usermod: no changes

please post the results of the 'id' command from a terminal


id

lsatenstein
19th November 2017, 01:32 AM
Ozjd, long time no see. Since he is not an administrator, he can't follow the command you indicated. (catch 22). He may have also have problems with the Quotation marks.

gutsknucklebone (https://forums.fedoraforum.org/member.php?220178-gutsknucklebone)

Log in as root with the command line, issue the two commands
usermod -g wheel username
grep wheel /etc/group

tell us what you have as a result.

gutsknucklebone
19th November 2017, 06:30 AM
Ozjd, long time no see. Since he is not an administrator, he can't follow the command you indicated. (catch 22). He may have also have problems with the Quotation marks.

gutsknucklebone (https://forums.fedoraforum.org/member.php?220178-gutsknucklebone)

Log in as root with the command line, issue the two commands
usermod -g wheel username
grep wheel /etc/group

tell us what you have as a result.

in response to the first command I got the same thing usermod: no changes
in response to the second command I got wheel:x:10:

Not sure was I supposed to include the stuff in the brackets? Tried that and just got "command not found" and "no such file or directory."

Sorry I'm such a noob!

lsatenstein
19th November 2017, 07:09 PM
You should have wheel:x:10:gk


do Man groupadd and use groupadd
or
If you know about VI, or VIM, as root, edit /etc/group
search for wheel and append the gk
On saving the file, you should have admin privileges.

Jean Pierre
19th November 2017, 07:47 PM
Maybe you have typed :

usermod -g wheel username
instead of :

usermod -g wheel gk

marko
19th November 2017, 09:22 PM
Maybe you have typed :
usermod -g wheel username

instead of :
usermod -g wheel gk


The error message would have said something like "usermod: user 'username' does not exist'
He reported in post #5 that it errored out as:


usermod: no changes

gutsknucklebone
19th November 2017, 11:13 PM
Maybe you have typed :

instead of :

No I changed username to gk

gutsknucklebone
19th November 2017, 11:16 PM
You should have wheel:x:10:gk


do Man groupadd and use groupadd
or
If you know about VI, or VIM, as root, edit /etc/group
search for wheel and append the gk
On saving the file, you should have admin privileges.

tried both Man groupadd and use groupadd, both returned "command not found"

the rest of your post is like Chinese to me. total noob with Linux and programming in general.

ozjd
19th November 2017, 11:26 PM
Did you type the whole command, as in su -c "usermod -g wheel gk"?

gutsknucklebone
19th November 2017, 11:51 PM
Did you type the whole command, as in su -c "usermod -g wheel gk"?

yes and I just did it again too. Same thing returned as before, usermod:no changes

It seems like it knows gk is registered, but when I try to use sudo it forgets.

ozjd
20th November 2017, 12:11 AM
yes and I just did it again too. Same thing returned as before, usermod:no changes

It seems like it knows gk is registered, but when I try to use sudo it forgets.

If you type groups what does it show?

When you tried to use sudo did it ask for your password and you typed your password not the root one?

marko
20th November 2017, 12:22 AM
"Man groupadd" is really "man groupadd" I guess he got hit with some kind of spell checking that changed "m" to "M". Linux is case sensitive so "Man" means nothing to the system whereas "man" does.

"man" as in "manual", is the standard way (old) way of getting manual style details for commands in Linux. So for pretty much anything in linux there will be a manual page and you see it by passing the command name to 'man' as an argument.

The 'vi' and 'vim' are just file editors in Linux, 'vi' as in 'visual' editor and 'vim' as in "Vi IMproved' is just a fancier version of 'vi'.
Neither is very beginner friendly, I'd suggest using the 'nano' editor as it will show usage hints in the lower part of the window.

gutsknucklebone
20th November 2017, 01:11 AM
typed in :
groups

and it returns ;
wheel

both passwords are the same. I've been trying all commands in this thread with both the user and root terminals.

gutsknucklebone
20th November 2017, 01:12 AM
"Man groupadd" is really "man groupadd" I guess he got hit with some kind of spell checking that changed "m" to "M". Linux is case sensitive so "Man" means nothing to the system whereas "man" does.

"man" as in "manual", is the standard way (old) way of getting manual style details for commands in Linux. So for pretty much anything in linux there will be a manual page and you see it by passing the command name to 'man' as an argument.

The 'vi' and 'vim' are just file editors in Linux, 'vi' as in 'visual' editor and 'vim' as in "Vi IMproved' is just a fancier version of 'vi'.
Neither is very beginner friendly, I'd suggest using the 'nano' editor as it will show usage hints in the lower part of the window.

OK man groupadd pulls up the groupadd manual like you said.

Thanks for the suggestion on the nano editor I will look for it.

gutsknucklebone
20th November 2017, 01:14 AM
OK vi and vim pulls up the following:


~ VIM - Vi IMproved
~
~ version 8.0.1097
~ by Bram Moolenaar et al.
~ Modified by <bugzilla@redhat.com>
~ Vim is open source and freely distributable
~
~ Help poor children in Uganda!
~ type :help iccf<Enter> for information
~
~ type :q<Enter> to exit
~ type :help<Enter> or <F1> for on-line help
~ type :help version8<Enter> for version info

gutsknucklebone
20th November 2017, 01:18 AM
entered:
sudo dnf install nano

got:
Last metadata expiration check: 0:01:01 ago on Sun 19 Nov 2017 04:15:57 PM PST.
Package nano-2.8.4-1.fc26.x86_64 is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!

------
Does this mean I already have it? If so, how to pull it up? It doesn't come up searching my menu.

gutsknucklebone
20th November 2017, 01:21 AM
entered:
sudo dnf install nano

got:
Last metadata expiration check: 0:01:01 ago on Sun 19 Nov 2017 04:15:57 PM PST.
Package nano-2.8.4-1.fc26.x86_64 is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!

------
Does this mean I already have it? If so, how to pull it up? It doesn't come up searching my menu.

Nevermind, I think I figured it out. nano filename pulls up something that looks like it might be an editor, so I'm guessing that's it. Not sure what I'm supposed to do with it though. You just type in commands and it suggests corrections?

marko
20th November 2017, 03:27 AM
Nevermind, I think I figured it out. nano filename pulls up something that looks like it might be an editor, so I'm guessing that's it. Not sure what I'm supposed to do with it though. You just type in commands and it suggests corrections?

No, use it to edit the /etc/group file like Leslie suggested back in post 9 to make the wheel line like this:


wheel:x:10:gk

save and exit the nano editor, at that time sudo on your user gk should work.

gutsknucklebone
20th November 2017, 09:49 PM
please post the results of the 'id' command from a terminal


id


result of id command:
uid=1000(gk) gid=10(wheel) groups=10(wheel) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

gutsknucklebone
20th November 2017, 09:58 PM
No, use it to edit the /etc/group file like Leslie suggested back in post 9 to make the wheel line like this:


wheel:x:10:gk

save and exit the nano editor, at that time sudo on your user gk should work.

I know I am as green as they come here, but can you tell me step by step how to do that? Not getting anywhere fumbling around in the dark with this.

sidebrnz
21st November 2017, 12:32 AM
If you RTFM, you'll see that the command you suggested would force gk's primary group to be wheel, which he's not in. Of course there were no changes.

smr54
21st November 2017, 12:44 AM
I've just browsed this thread, but, assuming you are able to log in as root, you want, as root, to do

usermod -G wheel -a gk


There are other versions that do the same thing but that should add you to wheel.

Then, user gk should log out and log back in. At that point, as user gk, typing groups should show wheel among other groups.

nsnbm
21st November 2017, 03:48 AM
gutsknucklebone wrote:


result of id command:
uid=1000(gk) gid=10(wheel) groups=10(wheel) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023


That output of id shows an irregularity. The group id of the user gk should be the same id number as the user, i.e. as 1000.

For example on this machine:


[tom@owl ~]$ id
uid=1000(tom) gid=1000(tom) groups=1000(tom),10(wheel),11(cdrom),39(video),63( audio)


The user id and the group id are both 1000 on this single user machine.

Your post may have a typo, so you can check the group id with this command:


grep gk /etc/group

and the line that starts with gk should show the group id at the end. For example, in the case of tom:


[tom@owl ~]$ grep tom /etc/group
wheel:x:10:tom
cdrom:x:11:tom
video:x:39:tom
audio:x:63:tom
tom:x:1000:

gutsknucklebone
21st November 2017, 04:34 AM
I've just browsed this thread, but, assuming you are able to log in as root, you want, as root, to do

usermod -G wheel -a gk


There are other versions that do the same thing but that should add you to wheel.

Then, user gk should log out and log back in. At that point, as user gk, typing groups should show wheel among other groups.

That seems to have fixed the problem, though it did not acknowledge anything when I entered that code. But now sudo seems to be working fine. Thanks everyone for all your help.

smr54
21st November 2017, 09:34 AM
Unless there was an error, it wouldn't acknowledge anything, it would just return to the command prompt. So that's expected. Glad you got it working.

gutsknucklebone
21st November 2017, 10:08 AM
gutsknucklebone wrote:


That output of id shows an irregularity. The group id of the user gk should be the same id number as the user, i.e. as 1000.

For example on this machine:


[tom@owl ~]$ id
uid=1000(tom) gid=1000(tom) groups=1000(tom),10(wheel),11(cdrom),39(video),63( audio)


The user id and the group id are both 1000 on this single user machine.

There was no typo, that was a direct copy and paste from my terminal window.

Your post may have a typo, so you can check the group id with this command:


grep gk /etc/group

and the line that starts with gk should show the group id at the end. For example, in the case of tom:


[tom@owl ~]$ grep tom /etc/group
wheel:x:10:tom
cdrom:x:11:tom
video:x:39:tom
audio:x:63:tom
tom:x:1000:


There was no typo. I copied and pasted directly from my temrinal window. I did as you said and it returned the following:
wheel:x:10:gk
gk:x:1000:
gk2:x:1001:

like I said, it's working now, so whatever that last suggestion did worked.

gutsknucklebone
21st November 2017, 10:12 AM
Unless there was an error, it wouldn't acknowledge anything, it would just return to the command prompt. So that's expected. Glad you got it working.

Thanks for your help. I hope this thread is useful to others too. A google search turned up multiple people with this problem.

nsnbm
21st November 2017, 11:31 AM
I'm glad you got it working ... smr54 got it ... I had my wires crossed a bit and had direct editing of the /etc/group file in mind.