Add the user info the sshd_config file in /etc/ssh/sshd_config

Ensure the line is uncommented;


Subsystem sftp /usr/lib/openssh/sftp-server

Match User userbob
ForceCommand internal-sftp
ChrootDirectory /home/userbob
X11Forwarding no
AllowTcpForwarding no

 

Ensure the home directory is not group writeable. It should be 755.

/etc/init.d/ssh restart

service ssh restart

Test the login via SSH, the result should display this result:

This service allows sftp connections only.