• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1956
  • Last Modified:

How do I restrict SFTP users access to a specific directory?

Hello everybody!

I decided to not use FTP so I don't have to open up port 21, and use SFTP instead.  It works great for me, I use my SSH login.  But I want to set it up for someone else and let them only access the directory with their website, which is "/var/www/website".

So I want to add a new user, that can only access the server via SFTP, and when they log in using an SFTP client, they go straight to that directory and can only go into its subdirectories, not the parent directories.

thanks
0
parlays
Asked:
parlays
3 Solutions
 
woolmilkporcCommented:
Hi,

consider using 'rssh'. It supports 'chrooting' and restricting users to any or all of scp, sftp, rsync, rdist or cvs.

Here it is:

http://sourceforge.net/project/showfiles.php?group_id=65349

... and this is a neat howto:

http://www.cyberciti.biz/tips/rhel-centos-linux-install-configure-rssh-shell.html

wmp


0
 
amroxCommented:
I did exactly this once with SFTP on Redhat 5
I downloaded openssh 5.1, compiled/installed it then set up my chroot jail in sshd_config
Here is a guide which has a step by step process: http://rothwerx.com/node/8
0

Featured Post

Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now