How to configure an SSH server to only allow users to transfer files using the SFTP protocol, without being able to log in with their username ?
Note: If the user's shell to nologin or null is not possible to change this
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
Check your /etc/ssh/sshd_config.
Find the line something like
Subsystem sftp /usr/libexec/openssh/sftp-server.
Next you have two options (should work both, I do not remember which one I have used). First, you may register this executable as a shell and set it for the user, or, the second one, ForcedCommand for that user in sshd_config.