Posted by Hans-Henry Jakobsen
This is an alternative way of limiting the SSH access to only SFTP explained in my How to restrict users to SFTP only instead of SSH post.
Edit your /etc/sshd_config file and change your settings like this
Match User username
AllowTcpForwarding no
X11Forwarding no
ForceCommand /usr/libexec/sftp-server -l INFO
Replace username with the user name you would limit the SSH access for.