root@host # usermod -s /usr/lib/sftp-server username
This changes user's shell to sftp-server. The last step for this to work is to add '/usr/lib/sftp-server' to /etc/shells to make it a valid shell, eg. like this:
root@host # echo '/usr/lib/stfp-server' /etc/shells
There. Now you've setup a user who can only access your server with SFTP.
No comments:
Post a Comment