I have an SFTP server and have set user shells to nologin to restrict access to SFTP.  I want to set a conditional umask of 0002 so that newly created files are group writable for all SFTP users.  Can I put this code in their bashrc to ensure that all newly created files are group writable or is there a better method?  Red Hat 5/6 Linux.NFS3 filesystem
Does ~/.bashrc set environment for users whose shell is /sbin/nologin?
profile;umask
As @terdon stated in his comment, .bashrc is relevant only for users using bash. This is because the file is sourced when bash is launched.To achieve what you want to do, the easiest solution is to add the option -u to the line that reads something likeSubsystem  sftp    /usr/lib64/misc/sftp-serverin /etc/ssh/sshd_config. For example :Subsystem  sftp    /usr/lib64/misc/sftp-server -u 0002See man 8 sftp-server for details. 