I have change the user's (user1) password using root

passwd user1

but when i tried to ssh user@localhost or through gdm or tty it always failed

the journalctl log shows

Failed password for user1 from ::1 
FAILED LOGIN 1 FROM tty3 FOR user1, Authentication failure
pam_unix(gdm-password:auth): conversation failed
pam_unix(gdm-password:auth): auth could not identify password for [user1]

I'm using fresh Arch Linux installation (64-bit)


So the solution was, change the /etc/passwd file

for user1's shell from /usr/bin/bash into /bin/bash

| improve this answer | |
  • Just ran into the same problem. Any idea why this is? /usr/bin/bash and /bin/bash both execute a shell. But only the latter will allow proper login. – user98877 Jan 11 '15 at 19:32
  • yeah I never found any documentation for this – Kokizzu Jan 13 '15 at 0:58
  • Is /usr/bin/bash a symlink to /bin/bash? It may not work if it's a symlink. – LawrenceC Jan 13 '15 at 21:08
  • no.. -rwxr-xr-x 1 root root 787584 2014.10.06 13:06 /usr/bin/bash* it isn't -rwxr-xr-x 1 root root 787584 2014.10.06 13:06 /bin/bash* – Kokizzu Jan 14 '15 at 0:36
  • 4
    /usr/bin/bash is the same file as /bin/bash, as /bin is a symlink to /usr/bin. you can add /usr/bin/bash to the /etc/shells file and that should work for /usr/bin/bash login, but that's non-standard – hanetzer Feb 4 '15 at 3:09

1.Login as root enter username as root, I prefer text(tty# ex: tty2) mode for simplicity. Open it by
Ctrl + Alt + F#(any of function keys F2-F7)

username : root
password : 

2.Check for user's shell

$less /etc/passwd

you may see some thing like

mr_rathod:x:1000:1000:Abhay Raj Singh Rathod:/home/mr_rathod:/usr/bin/bash (unaccessible shell)
mr_rathod:x:1000:1000:Abhay Raj Singh Rathod:/home/mr_rathod:/bin/zsh (unvailable shell)

3.Change the passwd file fix it by editing passwd file

# nano /etc/passwd

changing shell to /bin/bash would work as it is present in most UNIX based system

| improve this answer | |

The solution is in the file /etc/shells as documented in man 5 shells.

To cut it short "[that] is a text file which contains the full pathnames of valid login shells".

Traditionally /etc/shells only contains /bin/sh and /bin/bash.

So, in order to "fix" that issue, you either add /usr/bin/bash to /etc/shells or change the user's shell to be /bin/bash for example by using chsh.

Modern distributions have /bin as a symlink to /usr/bin so the former fix should be the right one. Be warned that this could break a number of programs that don't use the getusershell() call but have hard-coded shell paths.

The one and only shell you should rely upon is /bin/sh, though.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.