1

So I just ran into an interesting issue. On Arch Linux, if I create a user that uses a shell from /usr/bin they cannot log in. I create the user with:

useradd -m -G wheel -s /usr/bin/bash username

and when they try to log in, they get 'Login Incorrect'. But if I edit /etc/passwd and change the shell to /bin/bash, everything works fine.

Any ideas what's going on here? Thanks!

Chris
  • 565
  • 4
    Is there an executable called bash in /usr/bin? Is this also listed in the list of valid login shells (/etc/shells)? – Kusalananda May 30 '18 at 13:00
  • Also, check the logs. On Debian/Ubuntu, the authentication stuff goes to /var/log/auth.log and any messages from PAM modules should be there, too. On Arch, they might be somewhere else, or perhaps you'll just have to go through journalctl: https://unix.stackexchange.com/questions/114189/where-are-my-sshd-logs – ilkkachu May 30 '18 at 16:04

2 Answers2

4

As the Arch Wiki makes clear:

Warning: In order to be able to log in, the login shell must be one of those listed in /etc/shells, otherwise the PAM module pam_shell will deny the login request. In particular, do not use the /usr/bin/bash path instead of /bin/bash, unless it is properly configured in /etc/shells.

cat /etc/shells                         
#
# /etc/shells
#

/bin/sh
/bin/bash
jasonwryan
  • 73,126
-3

If bash is in /bin/bash and /bin and /usr/bin are not linked together, then the login program cannot start the shell if you specify a wrong path to Bash.

If the binares are linked together, then you need to edit /etc/shells to include both variants.

schily
  • 19,173