SFTP user with limited access

Objective: create a sftp user but limited to certain directory ONLY!

[root@web.local-01 ]# uname -a
Linux web.local 2.6.18-164.6.1.el5 #1 SMP Tue Nov 3 16:12:36 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
[root@web.local-01 ]# adduser -d /home/limited/directory/path -g sftp-user username
[root@web.local-01 ]# echo "/home/limited/directory/path" >> /etc/shells

now testing:

adam-othmans-computer:~ alak$ sftp -o Port=9321 username@web.local
Connecting to web.local...
username@web.local 's password:
sftp> ls
sftp> mkdir testdir
sftp> ls
testdir
sftp> cd /
sftp> ls
Couldn't get handle: Permission denied
sftp> exit


Good!

kudos: hmlee, http://www.itworld.com/network-access-control/66828/sftp-only-user-accounts

//alak

Comments

Popular posts from this blog

Check SecStore KeyPhrase of Java Stack

Windows 2003 W2k3 Getting Current MTU Size

Python: thread.error: can't start new thread