Anita is My True Love


15 June, 2007

How to restrict users to SFTP only instead of SSH

Filed under: Linux

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/sftpserver 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.

http://network2007.blogspot.com/

Comments »

The URI to TrackBack this entry is: http://arnita.blogsome.com/2007/06/15/how-to-restrict-users-to-sftp-only-instead-of-ssh/trackback/

No comments yet.

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.






















Get free blog up and running in minutes with Blogsome
Theme designed by Minz Meyer