Centos – Chroot with CentOS 5.3 + openssh 4.3p2

centoschrootsftpssh

OS: CentOS 5.3, with openssh 4.3p2

Trying to set 'chroot' in ssh shell, but openssh version prior to 4.8 doesn't take below settings. yum update openssh open up to version 4.3 which is quite old. Doesn't CentOS support openssh 4.8 or up? If that's the case, how to set chroot with openssh 4.3? or is it better to just using FTP? My purpose is limit SFTP or FTP access to certain folder, not root folder. Thanks!

Match group sftponly
         ChrootDirectory /home/%u
         X11Forwarding no
         AllowTcpForwarding no
         ForceCommand internal-sftp

Best Answer

If you want to use openssh's sftp you will need to update your openssh binaries. Centos doesn't provide an "official" repo with an 4.8> version, so you will have to compile/install it your self, or find a 3rd party repo that has it.