Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Other Things Gentoo
  • Search

sudo command doesn't accept my password

Still need help with Gentoo, and your question doesn't fit in the above forums? Here is your last bastion of hope.
Post Reply
Advanced search
17 posts • Page 1 of 1
Author
Message
Zeromsu
n00b
n00b
Posts: 14
Joined: Mon Jul 16, 2012 2:52 pm

sudo command doesn't accept my password

  • Quote

Post by Zeromsu » Mon Jul 16, 2012 4:03 pm

Hello,

I have installed my first Gentoo system ca. one year ago but in case of time I could adapt it only fitful.
To simplify working on it I decided to install the sudo package, so I don't have to switch between the GUI and the root shell.
If I run

Code: Select all

 
sudo nano
in the root terminal it opens nano immediately. But when I try to open nano with root rights as "normal user" with the same command it asks for my password. I type it in press enter and it says: "Sorry, try again."

Code: Select all

user@Gentoo-System ~$ sudo nano
Passwort:
Sorry, try again.
Passwort:
Sorry, try again
Passwort:
Sorry, try again.
sudo: 3 incorrect password attemps
user@Gentoo-System ~$
I have tried to google to solve my problem, but there are so many posts of people who used the root password instead of the user password. Its really basic problem so I don't know what kind if information you need ... I have a amd64 Gentoo and I use Xfce as GUI... If you need something else e.g. an output or a file feel free to ask. :wink:

thanks for your effort,
Zeromsu
Top
disi
Veteran
Veteran
User avatar
Posts: 1354
Joined: Fri Nov 28, 2003 4:33 am
Location: Out There ...

  • Quote

Post by disi » Mon Jul 16, 2012 4:18 pm

Sounds like you are not mentioned in /etc/sudoers

Make sure you are in 'wheel', if not (as root):

Code: Select all

# gpasswd -a <user> wheel
Members of this group can also switch permanentally using:

Code: Select all

$ su -
for the session
Gentoo on Uptime Project - Larry is a cow
Top
GES
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 108
Joined: Sun Jun 12, 2005 8:41 am
Location: Budapest, Hungary

Re: sudo command doesn't accept my password

  • Quote

Post by GES » Mon Jul 16, 2012 4:33 pm

Zeromsu wrote:

Code: Select all

 
sudo nano
Works for me.

Code: Select all

ges@gestoo ~ $ sudo grep ^% /etc/sudoers
%wheel ALL=(ALL) ALL
ges@gestoo ~ $ groups
disk wheel uucp audio cdrom video games usb users vboxusers vmware plugdev portage utmp kvm
Top
Zeromsu
n00b
n00b
Posts: 14
Joined: Mon Jul 16, 2012 2:52 pm

  • Quote

Post by Zeromsu » Mon Jul 16, 2012 5:32 pm

Thanks for quick response :wink:
Sounds like you are not mentioned in /etc/sudoers

Make sure you are in 'wheel', if not (as root):

# gpasswd -a <user> wheel
Hm... I thought I've done this after I emerged the sudo package... Now sudo works in the terminal screen but not on the terminal in the GUI. And the shut down button in Xfce works fine now.
Any Ideas :?:
Top
khayyam
Watchman
Watchman
User avatar
Posts: 6227
Joined: Thu Jun 07, 2012 2:45 am
Location: Room 101

  • Quote

Post by khayyam » Mon Jul 16, 2012 6:05 pm

Zeromsu ...

in the console your probably starting a new shell, whereas the X11 session is the child of a process started before your user was modified, and so its probably simply a matter of restarting your session/login.

best ... khay
Top
Zeromsu
n00b
n00b
Posts: 14
Joined: Mon Jul 16, 2012 2:52 pm

  • Quote

Post by Zeromsu » Mon Jul 16, 2012 6:20 pm

khay...
I restarted my hole computer (therefore also the X-server) after I added me to the wheel group... and nevertheless sudo in the Xfce-terminal doesn't accept my password.
Top
khayyam
Watchman
Watchman
User avatar
Posts: 6227
Joined: Thu Jun 07, 2012 2:45 am
Location: Room 101

  • Quote

Post by khayyam » Mon Jul 16, 2012 7:00 pm

Zeromsu ...

I see ... does 'groups' show your user being in the wheel group? Your shell should essencially provide the same enviroment whether using console or some terminal application, so its a little baffling it works for one and not the other.

Anyhow, other than checking with 'groups' there is nothing I can suggest, sorry.

best ... khay
Top
Logicien
Veteran
Veteran
User avatar
Posts: 1555
Joined: Fri Sep 16, 2005 8:04 am
Location: Montréal

  • Quote

Post by Logicien » Mon Jul 16, 2012 8:30 pm

You can specify that the members of the wheel group do not have to give a password to execute a command in /etc/sudoers with the visudo command:

Code: Select all

##
## User privilege specification
##
root ALL=(ALL) ALL

## Uncomment to allow members of group wheel to execute any command
# %wheel ALL=(ALL) ALL

## Same thing without a password
%wheel ALL=(ALL) NOPASSWD: ALL
It can be a security weakness. You have to trust the users in the wheel group.
Paul
Top
Apheus
Guru
Guru
Posts: 422
Joined: Sat Jul 12, 2008 7:16 pm

  • Quote

Post by Apheus » Tue Jul 17, 2012 9:44 am

What do the logs say, after a failed sudo attempt:

Code: Select all

# tail /var/log/messages
And, maybe your computer uses different keyboard layouts when you try to "sudo", than when you did set your password and when you login normally. I doubt it, but you can try anyway with a password simple enough, like "test".
Top
Zeromsu
n00b
n00b
Posts: 14
Joined: Mon Jul 16, 2012 2:52 pm

  • Quote

Post by Zeromsu » Thu Jul 19, 2012 11:21 am

Thanks anyway khay ;)
I tested "groups" command in the normal terminal as user and in the Xfce-terminal: The same output, wheel in both.
You can specify that the members of the wheel group do not have to give a password to execute a command in /etc/sudoers with the visudo command:
Yea, that`s also possible, but I prefer to type the password. But maybe for testing sudo in the Xfce-terminal...

Code: Select all

user@Gentoo-System ~$ tail /var/log/messages
Jul 19 12:44:03 Gentoo-System kernel: HDMI status: Codec=0 Pin=3 Presence_Detect=1 ELD_Valid=1
Jul 19 12:44:03 Gentoo-System kernel: HDMI status: Codec=0 Pin=3 Presence_Detect=1 ELD_Valid=1
Jul 19 12:44:03 Gentoo-System kernel: HDMI status: Codec=0 Pin=3 Presence_Detect=1 ELD_Valid=1
Jul 19 12:44:03 Gentoo-System kernel: HDMI status: Codec=0 Pin=3 Presence_Detect=1 ELD_Valid=1
Jul 19 12:44:04 Gentoo-System kernel: HDMI status: Codec=0 Pin=3 Presence_Detect=1 ELD_Valid=1
Jul 19 12:44:26 Gentoo-System sudo: user : TTY=tty3 ; PWD=/home/user ; USER=root ; COMMAND=/bin/tail /var/log/messages
Jul 19 12:44:26 Gentoo-System sudo: pam_unix(sudo:session): session opened for user root by user(uid=0)
Jul 19 12:44:26 Gentoo-System sudo: pam_unix(sudo:session): session closed for user root
Jul 19 12:45:45 Gentoo-System sudo: user : TTY=tty3 ; PWD=/home/user ; USER=root ; COMMAND=/bin/tail /var/log/messages
Jul 19 12:45:45 Gentoo-System sudo: pam_unix(sudo:session): session opened for user root y user(uid=0)
Keyboard setup is ok.

Maybe a clue: After I run emerge [...]:

Code: Select all

IMPORTANT: Config file  '/etc/sudoers' need updating.
Top
Zeromsu
n00b
n00b
Posts: 14
Joined: Mon Jul 16, 2012 2:52 pm

  • Quote

Post by Zeromsu » Tue Jul 24, 2012 10:48 am

O.K. a

Code: Select all

etc-update
solved nothing without hanging on

Code: Select all

waiting for uevents to be processed ...
for minutes on booting :? and a not working keyboard after the bootup. - But this is another problem...

I've also tested to uncomment:

Code: Select all

%wheel ALL=(ALL) NOPASSWD: ALL
in /etc/sudeoers. Sudo works now on the Xfce-Terminal without password. But it still doesn't accept my password when it's commented out. Does anybody know where the bug could be??? Maybe a very little hint which tells me in what direction I have to think???
Top
khayyam
Watchman
Watchman
User avatar
Posts: 6227
Joined: Thu Jun 07, 2012 2:45 am
Location: Room 101

  • Quote

Post by khayyam » Tue Jul 24, 2012 3:15 pm

Zeromsu wrote:"waiting for uevents to be processed ..." for minutes on booting and a not working keyboard after the bootup. - But this is another problem...
Zeromsu ... I think these may actually be related, have you changed your keymap (/etc/conf.d/keymaps)? The keymap would effect how the console understands kbd input, and X11 may not be configured for the same kbd layout.

best ... khay
Top
Zeromsu
n00b
n00b
Posts: 14
Joined: Mon Jul 16, 2012 2:52 pm

  • Quote

Post by Zeromsu » Mon Jul 30, 2012 6:35 pm

O.K. the uevents-error is gone - I don't know why, I have nothing changed. The keyboard works also fine now. I've checked the /etc/conf.d/keymaps but can't find any mistake. I have emerged an other terminal, too, but it's the same thing... sudo doesn't accept my password.
The old and the new terminal are both emerged. Could it be that portage has linked the terminals a wrong way or anything like this??? Maybe I've setup something wrong...

Is there another possibility to check the password in the Xfce-terminel (without "sudo" or "su")???
Does the Xfce-terminel check my password if correct or does it send the password to another program, which checks it and tells if correct? Maybe I have inadvertently changed the "word" which the Xfce-terminal uses to check the typed password. Or is it in the same file the console uses? (Know what I trying to say?)
Top
russellD
n00b
n00b
Posts: 66
Joined: Tue Oct 07, 2014 11:13 pm
Location: 28.5797S,153.338 E

  • Quote

Post by russellD » Thu Jan 04, 2018 12:36 am

I got this happen today and although this is a necropost, it is on topic and has an effective solution to this:

Code: Select all

user@Gentoo-System ~$ sudo nano
Passwort:
Sorry, try again.
Passwort:
Sorry, try again
Passwort:
Sorry, try again.
sudo: 3 incorrect password attemps 
It was due to sys-auth/pambase been installed as binary package made from a non-local machine.

Steps to fix this are:

1) comment out binary package from make.conf
#FEATURES="buildpkg userfetch getbinpkg"

and comment out binary host from make.conf
#PORTAGE_BINHOST="http://192.168.1.18/gentoo/packages"

2) re-emerge sys-auth/pambase
$ emerge -v sys-auth/pambase

3) rebuild environment variables and reset profile
$ env-update && source /etc/profile

then the login was successful!
best wishes!
Top
Hu
Administrator
Administrator
Posts: 24403
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Thu Jan 04, 2018 2:53 am

Did you mean emerge --oneshot sys-auth/pambase? As given, your command adds pambase to the user's world file, which is likely not desirable. Moreover, there is no harm in building binary packages or in fetching as user, so removing those FEATURES is unnecessary. However, there may be harm in not reversing the changes of step 1 once the rebuild is complete.
Top
geol
n00b
n00b
Posts: 11
Joined: Tue Dec 18, 2018 5:49 pm

Any update about this issue?

  • Quote

Post by geol » Fri Jan 20, 2023 7:37 pm

Hi I encountered the same thing and got exhausted looking for solutions. Is there any update?
Top
Hu
Administrator
Administrator
Posts: 24403
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Fri Jan 20, 2023 8:09 pm

The post to which I replied 5 years ago had a proposed solution. If you still have problems, I suggest you open a new thread and provide the required debugging logs.
Top
Post Reply

17 posts • Page 1 of 1

Return to “Other Things Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic