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

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

SAP SWPM Software Provision Manager SL Toolset 1.0 SP22 Startup Options

SAP SystemCopy - Activation of TCI Notes, DigiSIgn Gone Wrong