LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-06-2022, 08:52 PM   #1
handshake92
Member
 
Registered: Mar 2022
Location: Asia
Distribution: Debian 11
Posts: 39

Rep: Reputation: 0
Question why is my password for sudo rejected?


Hi! Kindly advise why is my password [sudo] rejected ?
while trying to install a downloaded apps for debian
I have tried to key-in my sudo password in the terminal.
But it keep rejecting with the message "[user] is not in the sudoer file"
I have tried both the "root" & "user password" individually but the same rejection happens
What has happen?
Thanks for helping.

Last edited by handshake92; 04-06-2022 at 08:54 PM.
 
Old 04-06-2022, 08:54 PM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

pretty much as the error says. sudo is not configured to provide root access for that user.
Has it ever worked? Did you change something?

Evo2.
 
Old 04-06-2022, 09:02 PM   #3
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,380
Blog Entries: 28

Rep: Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163
Unless something has changed recently, Debian does not come with sudo configured for use.

Try using su. That works fine for me in Debian.
 
Old 04-06-2022, 09:02 PM   #4
uteck
Senior Member
 
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: Ubuntu based stuff for the most part
Posts: 1,177

Rep: Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501
From the console run the 'groups' command to list all the groups the logged in user is part of.
If you see 'sudo' in the list then you have a problem with your password.
 
Old 04-06-2022, 09:40 PM   #5
handshake92
Member
 
Registered: Mar 2022
Location: Asia
Distribution: Debian 11
Posts: 39

Original Poster
Rep: Reputation: 0
to evo-2 questions: No except for installing apps in the synpac repos.never temper with the system files
to frankbell suggestions: I have tried using su. It returns "root@desktop-QP:/home/stellar
to uteck suggestions: I type in "groups". It returns "root@desktop-QP:/home/stellar
What does it mean and what must I do now?
Thanks

Last edited by handshake92; 04-06-2022 at 09:57 PM.
 
Old 04-06-2022, 09:45 PM   #6
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,
Quote:
Originally Posted by handshake92 View Post
to frankbell suggestions: I have tried using su. It returns "root@desktop-QP:/home/stellar
That is the "root prompt". In that state, you can install the package.

Quote:
to uteck suggestions: I type in "groups". It returns "root@desktop-QP:/home/stellar
You need to run that as your normal user. Ie before running "su". The output should be single line listing the groups you are a member of. Eg something like
Code:
stellar audio video
Quote:
What must I do now?
Depending on the output of the groups command, you may want to add yourself to the sudo group so that you can use sudo in the way most online instructions assume your system is configured. If so, we can tell you how.

Evo2.

Last edited by evo2; 04-06-2022 at 09:52 PM.
 
Old 04-07-2022, 12:54 AM   #7
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by frankbell View Post
Unless something has changed recently, Debian does not come with sudo configured for use.

Try using su. That works fine for me in Debian.
It has changed "recently" (or at least it's an installer option now).
But the recommendation to use su instead still stands.
OP, please actually click on & read the links that are given to you.
 
Old 04-07-2022, 05:38 AM   #8
handshake92
Member
 
Registered: Mar 2022
Location: Asia
Distribution: Debian 11
Posts: 39

Original Poster
Rep: Reputation: 0
1st reply to EVO2.

Quote:
Originally Posted by evo2 View Post
Hi,

That is the "root prompt". In that state, you can install the package.
>>> As I am a newbie to Linux and is my very first tinkering with Linux command line, kindly be forgiving & advise what is the package to install & where is the link?

You need to run that as your normal user. Ie before running "su". The output should be single line listing the groups you are a member of. Eg something like
Code:
stellar audio video
>>> Not quite clear on this- what is the command to use?

Depending on the output of the groups command, you may want to add yourself to the sudo group so that you can use sudo in the way most online instructions assume your system is configured. If so, we can tell you how.
>>> where do I begin, to add my user to sudo group
Evo2.
Many thanks for been kind & forgiving.
 
Old 04-07-2022, 08:23 AM   #9
suramya
Member
 
Registered: Jan 2022
Location: Earth
Distribution: Debian
Posts: 249

Rep: Reputation: 102Reputation: 102
As others have mentioned you don't need to use sudo in Debian, you can run the commands as root (without sudo). But if you feel you want to configure it on your system, the following are the instructions I followed to enable it on my Debian system:

https://www.linuxfordevices.com/tuto...ers-to-sudoers
 
Old 04-07-2022, 09:24 PM   #10
handshake92
Member
 
Registered: Mar 2022
Location: Asia
Distribution: Debian 11
Posts: 39

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by suramya View Post
As others have mentioned you don't need to use sudo in Debian, you can run the commands as root (without sudo). But if you feel you want to configure it on your system, the following are the instructions I followed to enable it on my Debian system:

https://www.linuxfordevices.com/tuto...ers-to-sudoers
>> Well it did ask for password when I tried to install "Dolibarr.CRM"
that is when I keyed the correct password. It returns the following:
" [sudo] password for handshake92 - sorry try again. handshake92 is not in the sudoer file.

It is strange for every time when I login into Debian desktop pc, I keyed my user password -it is accepted and while using the pc it will ask for password "authenication is required to mount ST1000x-xxx (/dev/sb2) Administrator -which i did key in the password without any problem.

However when I tried to add my "handshake92 to sudoer as advised-using Debian's ISO image -Xterm" terminal app.. The error is always as follows:
-1.$ su, password xxxxxx.
su:authentication failure.
handshake92 is not in sudoers file. This will be reported.

-2.handshake92@Desktop-QP61AKG:~$ usermod -aG sudo handshake92.
bash:usermod: command not found
Kindly advised what must I do?
Thanks for helping.
 
Old 04-07-2022, 09:40 PM   #11
uteck
Senior Member
 
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: Ubuntu based stuff for the most part
Posts: 1,177

Rep: Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501
That is odd. The command is in /usr/sbin/usermod so try the full path?
Since it looks like you can su to root, another way would be to su to root, then edit /etc/groups and add your user to the sudo group like so;
Quote:
sudo:x:27:YOURUSERNAME
 
1 members found this post helpful.
Old 04-07-2022, 09:54 PM   #12
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,783

Rep: Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936
FYI debain does not include /user/sbin in a regular user's path which is why the OP sees the command not found error.

su switches to root but still uses the user's environment
su - switches to root but switches to root's environment too.
 
Old 04-08-2022, 05:16 AM   #13
suramya
Member
 
Registered: Jan 2022
Location: Earth
Distribution: Debian
Posts: 249

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by michaelk View Post
FYI debain does not include /user/sbin in a regular user's path which is why the OP sees the command not found error.

su switches to root but still uses the user's environment
su - switches to root but switches to root's environment too.
Yup, it was very annoying till I got used to always running su - instead of plain su.

Quote:
However when I tried to add my "handshake92 to sudoer as advised-using Debian's ISO image -Xterm" terminal app.. The error is always as follows:
-1.$ su, password xxxxxx.
su:authentication failure.
handshake92 is not in sudoers file. This will be reported.

-2.handshake92@Desktop-QP61AKG:~$ usermod -aG sudo handshake92.
bash:usermod: command not found
Kindly advised what must I do?
Try adding the user to the sudoers file:

Switch to root user and then:
  • Run 'visudo' (without the quotes)
  • Scroll down to the User Privilege section and add the following line:

Code:
handshake92 ALL=(ALL:ALL) ALL
Save and exit. You should now be able to sudo
 
Old 04-08-2022, 05:57 AM   #14
handshake92
Member
 
Registered: Mar 2022
Location: Asia
Distribution: Debian 11
Posts: 39

Original Poster
Rep: Reputation: 0
why is my password for sudo rejected?

Quote:
Originally Posted by suramya View Post
Yup, it was very annoying till I got used to always running su - instead of plain su.



Try adding the user to the sudoers file:

Switch to root user and then:
  • Run 'visudo' (without the quotes)
  • Scroll down to the User Privilege section and add the following line:

Code:
handshake92 ALL=(ALL:ALL) ALL
Save and exit. You should now be able to sudo
>>> As advised,in XTerm app,I type in at handshake92@DESKTOP-QP61AKG"~$ su, keyed-in my password and at.... (I type in visudo)
root@DESKTOP-QP61AKG:/home/handshake92# visudo
it returns:
bash: visudo: command not found
root@DESKTOP-QP61AKG:/home/handshake92#

Where did I go wrong? Kindly advise.Thanks for helping.
 
Old 04-08-2022, 06:45 AM   #15
TorC
Member
 
Registered: Dec 2020
Location: as far S and E as I want to go in the U.S.
Distribution: Fossapup64
Posts: 224

Rep: Reputation: 78
[SOLVED] Debian error msg: bash: visudo: command not found

Where did OP go wrong? IMO, trying to use sudo in debian.

May I suggest using a search engine to find your answers before going to a forum?

Last edited by TorC; 04-08-2022 at 06:47 AM.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to Create Sudo User and Change Sudo Password Timeout in Ubuntu LXer Syndicated Linux News 0 04-26-2021 03:46 PM
LXer: The Ultimate Sudo FAQ — To Sudo Or Not To Sudo? LXer Syndicated Linux News 13 04-13-2013 01:36 AM
[SOLVED] sudo password different from non-sudo password edrom Linux - Newbie 2 04-20-2012 03:00 PM
"X11 connection rejected because of wrong authentication." and sudo DennisC31 AIX 1 08-24-2011 09:27 AM
SuSE93 Root password rejected from normal user mode (No Sudo, No YaST) Peacepunk SUSE / openSUSE 2 02-11-2007 06:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration