1

How do I get the default login shell of a specific user in linux. The user isn't necessarily in /etc/passwd. They may be logging in with NIS or LDAP or other pam method.

fakedrake
  • 993

1 Answers1

1
$ getent passwd "${username}" | awk -F: '$0=$7'

If the user exists both locally and e.g. in LDAP this will return multiple entries so you will need to decide on one line being returned.