Posted by hruske on Sun 13 Feb 2005 at 21:52
Sometimes you want to have users, that have access to files on your server, but don't want them to be able to log in and execute commands on your server.
This is done quite easily.
Add user as usually and assign him a password. Then run the following command (replace the 'username' with real user name):
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.
This article can be found online at the Debian Administration website at the following bookmarkable URL:
This article is copyright 2005 hruske - please ask for permission to republish or translate.