Terminal issue

New to Debian (Or Linux in general)? Ask your questions here!

Terminal issue

Postby 3hre » 2018-08-07 17:32

"wicked is not in the sudoers file. This incident will be reported."

A websearch shows that this appears to be common but recommendations to correct it have been unsuccessful.
3hre
 
Posts: 29
Joined: 2018-08-07 17:29

Re: Terminal issue

Postby cds60601 » 2018-08-07 17:35

Have you tried:

Code: Select all
man sudo



Cheers
Chris
Yeah, 220, 221. Whatever it takes.
Server: Debian 9 (Stretch) Workstation: Archlinux
User avatar
cds60601
 
Posts: 136
Joined: 2017-11-25 05:58

Re: Terminal issue

Postby GarryRicketson » 2018-08-07 17:57

This has been asked a few 100 times on this forum, here is 1;
http://forums.debian.net/viewtopic.php?f=30&t=135575&hilit=not+in+the+sudoers+file

A websearch shows that this appears to be common but recommendations to correct it have been unsuccessful.

please show us exactly what you have tried, then maybe someone can say
something about why it was not successful. Use "code boxes", and show us
what you tried. Not what some link to a tutorial you read some where, and what it says,but exactly what you actually tried.
Last edited by GarryRicketson on 2018-08-07 18:04, edited 1 time in total.
User avatar
GarryRicketson
 
Posts: 5193
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Terminal issue

Postby arochester » 2018-08-07 18:01

Code: Select all
usermod -a -G sudo <username>


Replace <username> with your username to which you want to grant sudo access.

Now logout & login to get sudo access to those users.
arochester
 
Posts: 1349
Joined: 2010-12-07 19:55

Re: Terminal issue

Postby 3hre » 2018-08-07 18:06

cds60601 wrote:Have you tried:

Code: Select all
man sudo



Cheers
Chris


No, I have not. I am confused/concerned as to why the username I identified when I installed is not being recognized?
3hre
 
Posts: 29
Joined: 2018-08-07 17:29

Re: Terminal issue

Postby GarryRicketson » 2018-08-07 18:08

Additional "hint"
Code: Select all
garry$ usermod -a -G sudo garry   
usermod: Program must be run as root
$
 
User avatar
GarryRicketson
 
Posts: 5193
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Terminal issue

Postby 3hre » 2018-08-07 18:11

3hre wrote:
cds60601 wrote:Have you tried:

Code: Select all
man sudo



Cheers
Chris


No, I have not. I am confused/concerned as to why the username I identified when I installed is not being recognized?


And ... for the sake that is all that is good in this world ... it does not seem to be responding to these commands ~ unless I am doing it wrong

icked@Wicked:~$ sudoedit
usage: sudoedit [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt]
[-u user] file ...
wicked@Wicked:~$ sudoedit -u user Wicked
sudoedit: unknown user: user
sudoedit: unable to initialize policy plugin

wicked@Wicked:~$ sudoedit -u Wicked

usage: sudoedit [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt]
[-u user] file ...
wicked@Wicked:~$ sudoedit -u
[sudo] password for wicked:

wicked is not in the sudoers file. This incident will be reported.
wicked@Wicked:~$ sudoedit -u

sudoedit: option requires an argument -- 'u'
usage: sudoedit [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt]
[-u user] file ...

wicked@Wicked:~$ sudoedit [-u user]
[sudo] password for wicked:
wicked is not in the sudoers file. This incident will be reported.
wicked@Wicked:~$
3hre
 
Posts: 29
Joined: 2018-08-07 17:29

Re: Terminal issue

Postby GarryRicketson » 2018-08-07 18:32

Can you use "su" to log in as root ?
To run the command shown by arochester, you must be root , you did set a root
password when you installed Debian , didn't you ?,... or if you didn't we need to know that, also what version of Debian you installed.

I am confused/concerned as to why the username I identified when I installed is not being recognized?


There have been some problems in some Debian versions, with this, so it is important to know what version you have installed.
Does 'man sudo' give you a manual , it should ?
======= edit ====
Also, see
Code: Select all
man sudoedit

What file do you need to edit as sudo ?


A example of using "sudoedit" :
Code: Select all
$  sudoedit /etc/apt/sources.list

Would open /etc/apt/sources.list, and you would be able to edit it. It (sudo) would prompt you for your password first. Normally the /etc/apt/sources.list file requires root privileges to edit, so that is what "sudoedit" is used for, to edit files that require root privileges.
Or, for another example, a file in your home directory, that has write permissions for the user:
Code: Select all
$ pwd
/home/garry
garry$ sudoedit top.txt
Password:
sudoedit: top.txt: editing files in a writable directory is not permitted
garry$
 

'sudoedit' will not work, it is not needed.

Since it says 'wicked" is not in the sudoers file, you can double check with this command :
Code: Select all
grep sudo /etc/group

Is "wicked" listed ?
http://forums.debian.net/viewtopic.php?f=10&t=138188&p=677812&#p677812
========== edited ===========
The command shown by arrochester :
Postby arochester » 2018-08-07 12:01
[code]
usermod -a -G sudo <username> [/coe]

Should work, if you can use 'su' to become root,... Below, is a screen shot,
as you can see, I was not in the sudo group, so I ran the command, and it added me.
Image
User avatar
GarryRicketson
 
Posts: 5193
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Terminal issue

Postby 3hre » 2018-08-07 20:46

I did set a root password on install; I installed Debian 9.5; man sudo does give me a manual (some of the stupid errors in there were just me being a stressed idiot and hit enter too soon)

wicked@Wicked:~$ sudo mv firefox /opt
[sudo] password for wicked:
wicked is not in the sudoers file. This incident will be reported.
wicked@Wicked:~$ grep sudo /etc/group
sudo:x:27:
wicked@Wicked:~$ grep sudo /etc/group
sudo:x:27:
wicked@Wicked:~$ usermod -a -G sudo Wicked
bash: usermod: command not found
wicked@Wicked:~$ usermod -a -G sudo wicked
bash: usermod: command not found
wicked@Wicked:~$ usermod -a -G sudo <username>
bash: syntax error near unexpected token `newline'
wicked@Wicked:~$ grep sudo /etc/group
sudo:x:27:
wicked@Wicked:~$ [code]
bash: [code]: command not found
wicked@Wicked:~$ usermod -a -G sudo <username> [/coe]
bash: username: No such file or directory
wicked@Wicked:~$ [code]
bash: [code]: command not found
wicked@Wicked:~$ usermod -a -G sudo Wicked [/coe]
bash: usermod: command not found
wicked@Wicked:~$
3hre
 
Posts: 29
Joined: 2018-08-07 17:29

Re: Terminal issue

Postby GarryRicketson » 2018-08-07 21:26

I did set a root password on install

ok, that's good,.. What I see that you are doing wrong,..
You must become root to run the "usermod" command,
so, type su, it will ask for the password , use the one you set when you installed.
you should see a change, the $ will change to # , that indicates you are root.
Code: Select all
garry$  su
Password:
garry#
 

You can verify, if you are root by using the 'whoami' command:
Code: Select all
garry# whoami
root
garry#

then type in the command;
Code: Select all
usermod -a -G sudo Wicked

(If you want Wicked, if you want wicked, all lower case, use that)
After running the 'usermod' command be sure to exit:
Code: Select all
garry# exit
garry$

Then run the 'grep' command;
Code: Select all
garry$ grep sudo /etc/group

==============================

It looks like you are copy/pasting, badly. these commands should not include the word code, inside brackets,..:



the reason this does not work ;
Code: Select all
wicked@Wicked:~$ usermod -a -G sudo Wicked
bash: usermod: command not found
wicked@Wicked:~$ usermod -a -G sudo wicked
bash: usermod: command not found

Is because you did not login as root using 'su'. you must be root to run that command.
Last edited by GarryRicketson on 2018-08-07 21:56, edited 1 time in total.
User avatar
GarryRicketson
 
Posts: 5193
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Terminal issue

Postby 3hre » 2018-08-07 21:47

wicked@Wicked:~$ su
Password:
root@Wicked:/home/wicked# usermod -a -G sudo Wicked
usermod: user 'Wicked' does not exist
root@Wicked:/home/wicked#

And this is where my brain feels like it is breaking a little ... because I know what I typed in when I installed and I feel so annoyed that I am thinking maybe I should just reinstall all over again lol

GarryRicketson wrote:
I did set a root password on install

ok, that's good,.. What I see that you are doing wrong,..
You must become root to run the "usermod" command,
so, type su, it will ask for the password , use the one you set when you installed.
you should see a change, the $ will change to # , that indicates you are root.
Code: Select all
garry$  su
Password:
garry#
 

You can verify, if you are root by using the 'whoami' command:
Code: Select all
garry# whoami
root
garry#

then type in the command;
Code: Select all
usermod -a -G sudo Wicked

(If you want Wicked, if you want wicked, all lower case, use that)
After running the 'usermod' command be sure to exit:
Code: Select all
garry# exit
garry$

Then run the 'grep' command;
Code: Select all
garry$ grep sudo /etc/group

==============================

It looks like you are copy/pasting, this
Code: Select all
[code] [/code] should not be part of the commands;
[quote]wicked@Wicked:~$ [code]
bash: [code]: command not found
wicked@Wicked:~$ usermod -a -G sudo <username> [/coe]
bash: username: No such file or directory
wicked@Wicked:~$ [code] [/quote]
 the reason this does not work ;
[code]wicked@Wicked:~$ usermod -a -G sudo Wicked
bash: usermod: command not found
wicked@Wicked:~$ usermod -a -G sudo wicked
bash: usermod: command not found

Is because you did not login as root using 'su'. you must be root to run that command.
3hre
 
Posts: 29
Joined: 2018-08-07 17:29

Re: Terminal issue

Postby GarryRicketson » 2018-08-07 22:14

Use the 'whoami' command like I showed:
Code: Select all
$ whoami
$ garry

You will see the user is NOT Wicked, it is wicked,.... I see that because it shows:
Code: Select all
wicked@Wicked:~$ su

user@Hostmame, your hostname is Wicked, but your username is wicked.
It shows here as well:
Code: Select all
root@Wicked:/home/wicked# 

The username, is used for the directory you are in, and it says, "wicked",
NOT : Wicked
=====
Try :
Code: Select all
usermod -a -G sudo wicked
and see what happens, you must remember/know, Linux is all ways case sensitive, if the user name is
"wicked", "Wicked" will not work, that is a different username.
Maybe you thought you used W but didn't , I don't know on that.
My thoughts are though, and I don't mean to sound rude, but I think you need to read some lessons, documentation, and learn more about linux, before you start trying to do anything using "sudo" or "su",...

You can create a user named Wicked , using the 'adduser ' command
See:
Code: Select all
man adduser

=== edited, adduser is easier, ....

maybe I should just reinstall all over again lol

Not at all necessary, but that is entirely up to you.
Last edited by GarryRicketson on 2018-08-07 23:43, edited 3 times in total.
User avatar
GarryRicketson
 
Posts: 5193
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Terminal issue

Postby cds60601 » 2018-08-07 22:35

3hre wrote:I did set a root password on install; I installed Debian 9.5; man sudo does give me a manual (some of the stupid errors in there were just me being a stressed idiot and hit enter too soon)

wicked@Wicked:~$ sudo mv firefox /opt
[sudo] password for wicked:
wicked is not in the sudoers file. This incident will be reported.
wicked@Wicked:~$ grep sudo /etc/group
sudo:x:27:
wicked@Wicked:~$ grep sudo /etc/group
sudo:x:27:
wicked@Wicked:~$ usermod -a -G sudo Wicked
bash: usermod: command not found
wicked@Wicked:~$ usermod -a -G sudo wicked
bash: usermod: command not found
wicked@Wicked:~$ usermod -a -G sudo <username>
bash: syntax error near unexpected token `newline'
wicked@Wicked:~$ grep sudo /etc/group
sudo:x:27:
wicked@Wicked:~$ [code]
bash: [code]: command not found
wicked@Wicked:~$ usermod -a -G sudo <username> [/coe]
bash: username: No such file or directory
wicked@Wicked:~$ [code]
bash: [code]: command not found
wicked@Wicked:~$ usermod -a -G sudo Wicked [/coe]
bash: usermod: command not found
wicked@Wicked:~$




Just a thought - instead of using Wicked , try using wicked.
I see that you keep using the "W" but your prompt shows "w"
As to the command. usermod failing- you need to be root first (since you mentioned you gave root a password on install, us it).


Cheers
Chris
Yeah, 220, 221. Whatever it takes.
Server: Debian 9 (Stretch) Workstation: Archlinux
User avatar
cds60601
 
Posts: 136
Joined: 2017-11-25 05:58

Re: Terminal issue

Postby GarryRicketson » 2018-08-07 22:38

myself>>You will see the user is NOT Wicked, it is wicked,.... I see that because it shows:

That is what I said as well, I think maybe the OP does not realize linux is case sensitive.
User avatar
GarryRicketson
 
Posts: 5193
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Terminal issue

Postby cds60601 » 2018-08-07 22:41

LOL Garry, I failed to see that. Oh my, the old eyes are playin' tricks on me.


Cheers
Chris
Yeah, 220, 221. Whatever it takes.
Server: Debian 9 (Stretch) Workstation: Archlinux
User avatar
cds60601
 
Posts: 136
Joined: 2017-11-25 05:58

Next

Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 7 guests

fashionable