View previous topic :: View next topic |
Author |
Message |
Zeromsu n00b
Joined: 16 Jul 2012 Posts: 14
|
Posted: Mon Jul 16, 2012 4:03 pm Post subject: sudo command doesn't accept my password |
|
|
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
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: |
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.
thanks for your effort,
Zeromsu |
|
Back to top |
|
|
disi Veteran
Joined: 28 Nov 2003 Posts: 1354 Location: Out There ...
|
Posted: Mon Jul 16, 2012 4:18 pm Post subject: |
|
|
Sounds like you are not mentioned in /etc/sudoers
Make sure you are in 'wheel', if not (as root):
Code: | # gpasswd -a <user> wheel |
Members of this group can also switch permanentally using:
for the session _________________ Gentoo on Uptime Project - Larry is a cow |
|
Back to top |
|
|
GES Tux's lil' helper
Joined: 12 Jun 2005 Posts: 108 Location: Budapest, Hungary
|
Posted: Mon Jul 16, 2012 4:33 pm Post subject: Re: sudo command doesn't accept my password |
|
|
Works for me.
Code: | 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
|
|
|
Back to top |
|
|
Zeromsu n00b
Joined: 16 Jul 2012 Posts: 14
|
Posted: Mon Jul 16, 2012 5:32 pm Post subject: |
|
|
Thanks for quick response
Quote: |
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 |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Mon Jul 16, 2012 6:05 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
Zeromsu n00b
Joined: 16 Jul 2012 Posts: 14
|
Posted: Mon Jul 16, 2012 6:20 pm Post subject: |
|
|
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. |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Mon Jul 16, 2012 7:00 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
Logicien Veteran
Joined: 16 Sep 2005 Posts: 1555 Location: Montréal
|
Posted: Mon Jul 16, 2012 8:30 pm Post subject: |
|
|
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: |
##
## 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 |
|
Back to top |
|
|
Apheus Guru
Joined: 12 Jul 2008 Posts: 422
|
Posted: Tue Jul 17, 2012 9:44 am Post subject: |
|
|
What do the logs say, after a failed sudo attempt:
Code: | # 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". |
|
Back to top |
|
|
Zeromsu n00b
Joined: 16 Jul 2012 Posts: 14
|
Posted: Thu Jul 19, 2012 11:21 am Post subject: |
|
|
Thanks anyway khay
I tested "groups" command in the normal terminal as user and in the Xfce-terminal: The same output, wheel in both.
Quote: | 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: |
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: |
IMPORTANT: Config file '/etc/sudoers' need updating.
|
|
|
Back to top |
|
|
Zeromsu n00b
Joined: 16 Jul 2012 Posts: 14
|
Posted: Tue Jul 24, 2012 10:48 am Post subject: |
|
|
O.K. a
solved nothing without hanging on
Code: |
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: |
%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??? |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Tue Jul 24, 2012 3:15 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
Zeromsu n00b
Joined: 16 Jul 2012 Posts: 14
|
Posted: Mon Jul 30, 2012 6:35 pm Post subject: |
|
|
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?) |
|
Back to top |
|
|
russellD n00b
Joined: 07 Oct 2014 Posts: 55 Location: 28.5797S,153.338 E
|
Posted: Thu Jan 04, 2018 12:36 am Post subject: |
|
|
I got this happen today and although this is a necropost, it is on topic and has an effective solution to this:
Code: |
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! |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21619
|
Posted: Thu Jan 04, 2018 2:53 am Post subject: |
|
|
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. |
|
Back to top |
|
|
geol n00b
Joined: 18 Dec 2018 Posts: 11
|
Posted: Fri Jan 20, 2023 7:37 pm Post subject: Any update about this issue? |
|
|
Hi I encountered the same thing and got exhausted looking for solutions. Is there any update? |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21619
|
Posted: Fri Jan 20, 2023 8:09 pm Post subject: |
|
|
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. |
|
Back to top |
|
|
|