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.
Asked
Active
Viewed 2,192 times
1 Answers
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.
Adrian Frühwirth
- 781