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

SAP: Segregate Different SMTP Mail Server Based on Sender Domain

SAP Client Copy Error: Errors occurred during export of container object FINB-TR-DERIVATION

Quick Dirty Script for Checking Oracle Data Gurad Gap and Emailing it