LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 11-20-2008, 02:38 PM   #1
Ryanitus
LQ Newbie
 
Registered: Jan 2003
Location: California
Distribution: Red Hat
Posts: 9

Rep: Reputation: 0
Repair User - su: incorrect password


Hello,

I have a system set up with an administrator account aside from root.

I've lost the ability to su to that administrator account, even from root. It was working fine a week ago.

When I log in as root, I get the following:

[root@localhost root]# su admin
su: incorrect password

I can su to any other account just fine.

[root@localhost root]# su user
bash-2.05b$

I've tried changing the root password and admin password, but nothing has helped. I've removed the admin entries from /etc/passwd and /etc/shadow and tried, and system says the account doesn't exist, which is expected. However, when I add them back, same problem.

Not sure if this matters or not, but the admin account password was set to expire after 60 days. I've checked the config files the account is not locked.

Is there a way to repair the admin account?

Thanks,
Ryan

Last edited by Ryanitus; 11-20-2008 at 02:47 PM.
 
Old 11-20-2008, 03:02 PM   #2
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,943
Blog Entries: 5

Rep: Reputation: 753Reputation: 753Reputation: 753Reputation: 753Reputation: 753Reputation: 753Reputation: 753
Look at the "passwd -u" option to unlock the account - it probably got locked due to expiration. You can also use the "chage" command to deal with setting expiration values.
 
Old 11-20-2008, 04:21 PM   #3
Ryanitus
LQ Newbie
 
Registered: Jan 2003
Location: California
Distribution: Red Hat
Posts: 9

Original Poster
Rep: Reputation: 0
*** solution ***

I had checked everything concerning the /etc/passwd and /etc/shadow files, everything seemed to be ok. I tried locking and unlocking with 'passwd -l' and 'passwd -u', but still no go.

As it turns out, there were cron jobs that did a su to the admin account.

When the password expired, the cron job was being prompted for the password. After 3 login failures, the account was getting locked by PAM. This was due to using the pam_tally.so module.

To fix the problem, I removed deny= argument from /etc/pam.d/system-auth.

Before:
account required /lib/security/$ISA/pam_tally.so per_user deny=3 no_magic_root reset

After:
account required /lib/security/$ISA/pam_tally.so per_user no_magic_root reset
 
Old 03-07-2009, 07:32 PM   #4
alam
Member
 
Registered: May 2004
Posts: 47

Rep: Reputation: 16
hello,

I use Mandriva 2009 on a Toshiba laptop.

As a user, if I run 'su', I get 'su: incorrect password'. The password is correct because I can login as root.

I do not see anything like "deny=" in my system.auth file.

Any idea?


alam--
 
Old 03-09-2009, 03:12 PM   #5
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,943
Blog Entries: 5

Rep: Reputation: 753Reputation: 753Reputation: 753Reputation: 753Reputation: 753Reputation: 753Reputation: 753
Please do not append to old threads. You'll get much more visibility by starting a new one.
 
Old 06-08-2009, 06:44 AM   #6
gmdaas
LQ Newbie
 
Registered: Jun 2009
Posts: 1

Rep: Reputation: 0
solutions

Code:
chmod o+s /bin/su
so that it looks like

[root@localhost ~]# ls -l /bin/su
-rwsr-xr-x 1 root root 24120 May 24 2008 /bin/su
 
Old 12-03-2009, 08:21 PM   #7
vysakh@gmail.com
LQ Newbie
 
Registered: Jun 2009
Posts: 11

Rep: Reputation: 0
Hi Ryanitus,

Am having the same problem ..using RHEL 4 U 7.

Tried with locking unlocking passwd but no luck.

Have you managed to solve it ?
 
Old 12-03-2009, 08:56 PM   #8
vysakh@gmail.com
LQ Newbie
 
Registered: Jun 2009
Posts: 11

Rep: Reputation: 0
Hi all,

The account faillog count for the user was above threshold and this caused the pam denies the login.

Mine is got solved by ,

As a root

Step 1. Changing the entries in file /etc/pam.d/system-auth

password required /lib/security/$ISA/pam_cracklib.so retry=3 type=
password sufficient /lib/security/$ISA/pam_unix.so nullok use_authtok md5 shadow
password required /lib/security/$ISA/pam_deny.so
password required /lib/security/pam_unix.so remember=4 use_authtok md5 shadow

Change the required and sufficient to optional.

Step 2. remove the deny entry
account required /lib/security/pam_tally.so deny=5 reset no_magic_root

Remove the deny=5 entry from the above line.

Step 3. Save and quit.

Step 4. Su to user

step 5. Verify your failog for count is back to 0.By executing faillog -u user
Out will be similar like
Username Failures Maximum Latest
user 0 0

step 6. back to root

step 7. roll back all the changes done for /etc/pam.d/system-auth.

Hope it helped
Thanks and regards.
Vysakh Chandran.
 
Old 12-03-2009, 09:34 PM   #9
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,225

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
quicker/easier, use the -r (reset) option
http://linux.die.net/man/8/faillog
 
Old 12-03-2009, 10:35 PM   #10
vysakh@gmail.com
LQ Newbie
 
Registered: Jun 2009
Posts: 11

Rep: Reputation: 0
In my case , I had tried the Failog -r and was no exception ..

But yes. its worth a try before proceeding ahead with editing pam file.
 
  


Reply

Tags
su


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
GDM: Change 'incorrect user or password' text hex1a4 Linux - Software 1 05-18-2008 01:18 PM
kdesu gives incorrect password error with correct password. dasy2k1 Suse/Novell 1 04-16-2007 10:34 AM
incorrect user name or password hiieu Linux - General 4 03-09-2007 09:37 AM
User account problem (why incorrect password? -- but it is right!!!) namgor Linux - Software 0 07-15-2004 02:17 PM


All times are GMT -5. The time now is 05:07 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration