I currently use ActiveDirectory for authentication on my Ubuntu 10.04 servers using a tool called Centrify Express. Centrify has a custom .so file that is configured in /etc/pam.d/common-auth.
I'd like to do normal LDAP authentication (bypassing centrify) for just SFTP users (not SSH logins). How would I configure /etc/pam.d/sshd to try LDAP authentication for SFTP logins, but not SSH logins? The idea is that my SFTP OU would allow users to download, and upload files, but they wouldn't be able to get a shell.
If I understand your question correctly, you are looking to provide only
sftp
service (that is, no interactive logins viassh
).You can force connections to use the
sftp
service by adding this to yoursshd_config
file:This is documented in the
sshd_config
man page:You can modify
/etc/pam.d/sshd
to configure sshd to use the normalpam_ldap
module rather than thepam
module provided by Centrify.With these configuration changes in place,
sftp
connections will use normalLDAP
authentication, and interactive shells will not be available.I don't think you could limit it in pam, but if you make all the users you want to constrict members of one group, you can have ssh restrict what those users could do via match group blah.