Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
sudo command doesn't accept my password
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Zeromsu
n00b
n00b


Joined: 16 Jul 2012
Posts: 14

PostPosted: Mon Jul 16, 2012 4:03 pm    Post subject: sudo command doesn't accept my password Reply with quote

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:
 
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:

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
Back to top
View user's profile Send private message
disi
Veteran
Veteran


Joined: 28 Nov 2003
Posts: 1354
Location: Out There ...

PostPosted: Mon Jul 16, 2012 4:18 pm    Post subject: Reply with quote

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:
Code:
$ su -

for the session
_________________
Gentoo on Uptime Project - Larry is a cow
Back to top
View user's profile Send private message
GES
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jun 2005
Posts: 108
Location: Budapest, Hungary

PostPosted: Mon Jul 16, 2012 4:33 pm    Post subject: Re: sudo command doesn't accept my password Reply with quote

Zeromsu wrote:

Code:
 
sudo nano


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
View user's profile Send private message
Zeromsu
n00b
n00b


Joined: 16 Jul 2012
Posts: 14

PostPosted: Mon Jul 16, 2012 5:32 pm    Post subject: Reply with quote

Thanks for quick response :wink:

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
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Mon Jul 16, 2012 6:05 pm    Post subject: Reply with quote

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
View user's profile Send private message
Zeromsu
n00b
n00b


Joined: 16 Jul 2012
Posts: 14

PostPosted: Mon Jul 16, 2012 6:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Mon Jul 16, 2012 7:00 pm    Post subject: Reply with quote

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
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Mon Jul 16, 2012 8:30 pm    Post subject: Reply with 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:
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
View user's profile Send private message
Apheus
Guru
Guru


Joined: 12 Jul 2008
Posts: 422

PostPosted: Tue Jul 17, 2012 9:44 am    Post subject: Reply with quote

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
View user's profile Send private message
Zeromsu
n00b
n00b


Joined: 16 Jul 2012
Posts: 14

PostPosted: Thu Jul 19, 2012 11:21 am    Post subject: Reply with quote

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
View user's profile Send private message
Zeromsu
n00b
n00b


Joined: 16 Jul 2012
Posts: 14

PostPosted: Tue Jul 24, 2012 10:48 am    Post subject: Reply with quote

O.K. a
Code:

etc-update

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
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Tue Jul 24, 2012 3:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
Zeromsu
n00b
n00b


Joined: 16 Jul 2012
Posts: 14

PostPosted: Mon Jul 30, 2012 6:35 pm    Post subject: Reply with quote

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
View user's profile Send private message
russellD
n00b
n00b


Joined: 07 Oct 2014
Posts: 55
Location: 28.5797S,153.338 E

PostPosted: Thu Jan 04, 2018 12:36 am    Post subject: Reply with quote

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
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21593

PostPosted: Thu Jan 04, 2018 2:53 am    Post subject: Reply with quote

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
View user's profile Send private message
geol
n00b
n00b


Joined: 18 Dec 2018
Posts: 11

PostPosted: Fri Jan 20, 2023 7:37 pm    Post subject: Any update about this issue? Reply with quote

Hi I encountered the same thing and got exhausted looking for solutions. Is there any update?
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21593

PostPosted: Fri Jan 20, 2023 8:09 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum