0

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!

  • 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: unix.stackexchange.com/questions/114189/where-are-my-sshd-logs – ilkkachu May 30 '18 at 16:04
3

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
  • Truthfully, I completely forgot that /etc/shells existed. Thank you! – Chris Jun 4 '18 at 23:50
-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.

  • The binaries are installed to /usr/bin and are linked to /bin – Chris May 30 '18 at 13:21

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.