New in CWP Edge-LatestFree with every CWPpro licenceWebsites up to 300x faster

CWP now includes LSPHP, LSAPI-Cache and CWP Cage at no extra cost with all CWPpro licences. The LSAPI-Cache plugin is integrated into our WordPress and other script installers, and CWP Cage gives every user complete isolation. Available now in the CWP Edge-Latest version.

Get CWPpro ›

SFTP chroot

Started by ixus, April 25, 2015, 02:50:35 PM

Previous topic - Next topic

ixus

By default on my testserver and real server, I can walk out of my /home directory and view other peoplese files when using SFTP (or SSH). So user is not real chrooted.

I think I remember that this worked first time I tested, but not any more..

What is the best way to correct this? I have found a guide that explains how to do this step by step:
https://wiki.archlinux.org/index.php/SFTP_chroot

I have changed sshd to this:
Match Group vhosts
ChrootDirectory %h
ForceCommand internal-sftp
AllowTCPForwarding no
X11Forwarding no

Filezilla gives this:
Connected to XXX
Error:   Received unexpected end-of-file from SFTP server

Sercure-log gives this:
Apr 25 16:27:05 myhost1 sshd[35917]: pam_unix(sshd:session): session opened for user mytestuser by (uid=0)
Apr 25 16:27:05 myhost1 sshd[35919]: subsystem request for sftp
Apr 25 16:27:05 myhost1 sshd[35917]: pam_unix(sshd:session): session closed for user mytestuser

I have chown root for home-directory and I have added mytestuser to the group vhosts (a built in group already present would be better).

Administrator

at the moment there is no chrooted environment so you would need to manually allow sftp and by using online tutorials you can limit sftp.

It would be the best to only allow FTP or FTPES/FTPS.

misterpat

Could this be implemented in a future release?

robotech

Sounds like this product is not ready for prime time / production environments!     :-\  :-\  :-\

if you can move out of your folder via FTP ( or shell) and cat /etc/passwd - then not ready.

Yes, you CAN make adjustments to prevent this - but not being built in - a major problem.

Also, no CentOS 7 support?

Really?.....