LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-13-2004, 02:22 AM   #1
CGameProgrammer
Member
 
Registered: Oct 2004
Distribution: Yoper
Posts: 30

Rep: Reputation: 15
su doesn't accept my password


For some reason when I run 'su' and type the root password, it says it's incorrect, but it isn't. This didn't happen all of a sudden; I've never been able to get su to work. What could be causing this? I'm getting tired of constantly having to log out and log back in as the root.

I just tried running "passwd" as my user account, and when it prompted me for my current password, it said it was incorrect too! This is strange. Both passwords have both lowercase and uppercase letters, and some numbers and punctuation marks, if it matters.

Last edited by CGameProgrammer; 10-13-2004 at 02:24 AM.
 
Old 10-13-2004, 03:21 AM   #2
MartinN
Member
 
Registered: Nov 2003
Location: Ronneby, Sweden
Posts: 555

Rep: Reputation: 30
Do you set a different keyboard mapping when you log in? Try typing the password in a terminal window or somewhere else where you can see it.

Martin
 
Old 10-13-2004, 05:14 AM   #3
CGameProgrammer
Member
 
Registered: Oct 2004
Distribution: Yoper
Posts: 30

Original Poster
Rep: Reputation: 15
No, it's just the regular U.S. English layout. It would be nice if I could see what password it thought I was entering... that stuff isn't logged anywhere, by any chance, is it?
 
Old 10-13-2004, 05:27 AM   #4
MartinN
Member
 
Registered: Nov 2003
Location: Ronneby, Sweden
Posts: 555

Rep: Reputation: 30
I really don't think that is logged anywhere. It's bad security practice. If you just mis-type the password with one character it would be fairly easy to guess the password (especially if this happens twice with different characters mis-typed). The real password is not stored in unencrypted form anywhere either. The only thing stored is the encrypted password string and when you log in your password is encrypted and compared to the stored encrypted password.

Every failed attempt at su-ing is stored like this (in /var/log/messages)
Code:
Oct 13 12:19:27 charlene su(pam_unix)[20923]: authentication failure; logname= uid=500 euid=0 tty= ruser=martin rhost=  user=root
But still, try to type in the password in a way that you can see it. Try typing the password from the login window too. To see the password, just enter the password in the username field. This way you should be able to see if there is something fishy with your keyboard mappings.

Martin
 
Old 10-13-2004, 05:38 AM   #5
CGameProgrammer
Member
 
Registered: Oct 2004
Distribution: Yoper
Posts: 30

Original Poster
Rep: Reputation: 15
I typed the password regularly; it's definitely registering correctly. And the login window works fine, it's just terminal stuff like su and passwd that do not. Well, that's not quite true -- as root, I can run "passwd" which doesn't ask me for my existing one, just asks me to enter the new one. That works fine. But as a regular user, trying to change my password fails the password check, and trying to su to root also fails.

I just now experimentally set the root password to 'abc', logged in as the user account, and still su fails! It can't possibly think I'm typing anything other than 'abc' and the root password definitely was changed to that, so perhaps the account somehow doesn't have permission to use su? Or something? Of course that doesn't explain why changing its own password doesn't work either.

Last edited by CGameProgrammer; 10-13-2004 at 05:42 AM.
 
Old 10-13-2004, 06:36 AM   #6
MartinN
Member
 
Registered: Nov 2003
Location: Ronneby, Sweden
Posts: 555

Rep: Reputation: 30


*ding*

Is the sticky bit set for su?
Code:
[root@charlene log]# ls -lF /bin/su
-rwsr-xr-x    1 root     root        19132 Aug 29  2002 /bin/su*
The 's' in the permissions is for the sticky bit. This means that the command is run with the privileges from the user owning the command, not the privileges of the user executing the command. Change the settings of the sticky bit with chmod.

Martin
 
Old 10-13-2004, 06:41 AM   #7
case1984
Member
 
Registered: Feb 2003
Location: Baton Rouge, LA
Distribution: ubuntu
Posts: 137

Rep: Reputation: 15
try a different shell

I have no idea why this wouldn't work, but I'm sure it must be a pain.
I have a suggestion:
In order to rule out the shell itself as the cause of the problem, try using a different one. Most distros come with a number of shells installed. Oh, and make sure you are typing "su_-" (underscore is a space). I used to get all sorts of strange errors when I would leave out the -. You could also try typing "su - root". If that's not it, we are going to have to start looking at etc/pam.d to make sure your password files are correct and shadow passwords are set up correctly.

Michael
 
Old 10-13-2004, 12:07 PM   #8
CGameProgrammer
Member
 
Registered: Oct 2004
Distribution: Yoper
Posts: 30

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by MartinN
Is the sticky bit set for su?
Code:
[root@charlene log]# ls -lF /bin/su
-rwsr-xr-x    1 root     root        19132 Aug 29  2002 /bin/su*
The 's' in the permissions is for the sticky bit. This means that the command is run with the privileges from the user owning the command, not the privileges of the user executing the command. Change the settings of the sticky bit with chmod.
That fixed it! Thanks a lot. Everything works fine now.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
User account takes forever to accept password fr8_liner Linux - General 2 08-14-2005 09:38 AM
Screen saver doesn't accept password gargamel Slackware 2 02-27-2005 08:09 AM
Samba - folders asking for password but wont accept blink_00 Linux - Newbie 2 12-04-2004 12:38 AM
Mysql shell only accept blank password? robertoneto123 Linux - Networking 0 01-09-2004 02:42 PM
su root doesn't accept password Scheike Linux - General 2 09-10-2003 06:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:02 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