Chrooted sftp on rhel3

Karl Latiss karl.latiss at atvert.com.au
Sat Jun 16 09:05:28 UTC 2007


On Fri, 2007-06-15 at 11:42 +0100, Johan Booysen wrote:
> Hi everyone,
> 
> I'm doing some tests setting up an sftp server, with setting up a chroot
> jail for ftp users.
> 
> Everything seems to be working fine, but "ftpuser" can cd to outside his
> home directory (ftpuser cannot access the user1 or user2 directories,
> but can get to etc, lib, and user), which ideally I don't want.  I've
> played around with setting different permissions, but only the
> permissions below seem to work.
> 
> In /etc/rssh.conf, I've got the following to set the chroot path:
> chrootpath = /home
> 
> # pwd
> /home
> # ls -l
> total 24
> drwxr-xr-x    2 root     root         4096 Jun 15 10:41 etc
> drwx------    3 ftpuser  ftpuser      4096 Jun 15 11:20 ftpuser
> drwx------    4 user1    user1        4096 May 25 15:27 gmi
> drwx------    5 user2    user2        4096 Jun 14 16:54 jhb
> drwxr-xr-x    3 root     root         4096 Jun 14 17:28 lib
> drwxr-xr-x    6 root     root         4096 Jun 14 17:26 usr
> 
> I've then also removed all entries from the copy of the passwd file in
> /home/etc/passwd, so that only the ftp users' accounts appear in it.
> 
> Any ideas on how to restrict access so ftp users are locked into their
> own home directories - if that is even possible?  It doesn't seem like
> much of an issue to me, but I'd appreciate your thoughts.
> 
What is ftpuser's shell and home directory? Also have you set allowsftp
in /etc/rssh.conf ?

There also may be some clues in /var/log/messages depending on what you
have set logfacility to.

-- 
Karl Latiss <karl.latiss at atvert.com.au>
Atvert Systems




More information about the redhat-list mailing list