1

I would to like to restrict a user to certain directory(ies) but also allow to use SFTP for transfer.

I looked at the answers provided to similar questions at:

How do I setup SFTP for sites without giving shell access?

SFTP access akin to jailed shell

Unfortunately, the accepted answers only work on more current OpenSSH versions while my system is Centos 5.8,

OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008

I set up vsftpd using the following Rackspace guide: http://www.rackspace.com/knowledge_center/article/rackspace-cloud-essentials-5-centos-installing-vsftpd which works great by restricting user to their directories BUT only using ftp, it does not allow SSH (turned off shell using usermod)

I enabled sftp using the following guide: http://wiki.vpslink.com/Configuring_vsftpd_for_secure_connections_(TLS/SSL/SFTP)

Unfortunately, sftp was not allowed until I re-enabled bash shell for the user. Now sftp works, but they can leave their home directory and browse system files at will.

It is getting pretty close to shaving yaks now, so I wonder whether I should try to upgrade OpenSSH or is there another solution?

1 Answer 1

1

You either need to upgrade your OpenSSH install to a version >= 4.9p1, as this will offer native chroot support.

Alternatively install one of the following restricted shells, and change the users shell to match the installed package.

http://www.pizzashack.org/rssh/

https://github.com/scponly/scponly/wiki

There are a few more alternatives suggested on the scponly wiki.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .