LDAP loginShell on platforms with different paths
- by neoice
I'm using LDAP to deal with users and authentication across my network. I'm now adding FreeBSD hosts and have hit a problem with login shells. on Linux, shells tend to be in /bin/$shellname, so setting my login shell in LDAP to /bin/zsh works perfectly. on FreeBSD, /bin/zsh doesnt exist, I need to use /usr/local/bin/zsh. is there a solution to this? I imagine I might be able to make some sort of login-shell.sh script that LDAP passes out as the "shell" and then use the script to determine the actual shell for the user, but I'm not a fan of that idea.
I'm using Debian and FreeBSD, both with a standard OpenLDAP/PAM/nss setup.
edit: it looks like using /bin/sh and adding an exec $shell to .profile would "work", but that doesnt scale very well.