Question: Is it possible to change ssh behaviour to check for shell access authorisation before creating home directories? Bonus points for also showing the MOTD after shell authorisation, too.
Scenario: My linux users are controlled via SSSD pointed to AD.
I have a Ubuntu SFTP server with proftpd where my users are allowed to upload. Their chrooted upload directories are determined by group membership, not username. Users are not supposed to upload files into individual user home directories. They do not, and should not, have personal home directories on this server.
Here is my problem: If a user does attempt to log into the SFTP server with SSH a local user directory is created before ssh rejects shell access.
- They should not have local home directories. (SFTP puts them in the correct upload directories for our automated processes to pick up the files and do the necessary work with them.)
- I cannot override their home directories in AD as they need them for other user servers.
I need SSH to deny access BEFORE creating any home directories. (Bonus if I can also print the MOTD after shell access has been authorised!) I cannot simply turn off home directory creation as other user groups who do have shell access will need their home directories created automatically.
Thank you!