Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Currently setting up a Centos6.4 box and are wanting to jail sftp users upon login. I've been following the notes here http://www.thisisnotsupported.com/sftp-chrootjail-on-centos6. But I have one issue relating to the user home directory.

This tutorial lists the ChrootDirectory as

ChrootDirectory /var/www/vhosts/%u

This uses the user name for the home directory. However, I have specified a different home directory for the user which I would like to use instead. When attempting a login the directory looked for is based on the user name and not the specified home directory.

I've searched the documentation for the relevant % key I should be using here but have come up blank.

Can anybody assist and suggest which key I should be using here?

Many thanks

share|improve this question

1 Answer 1

Appears that you can use %h which the uses the specified home directory so in my case:

ChrootDirectory %h

Another concern is the requirement for the container folder to be owned by root should any one stumble across this.

share|improve this answer
1  
Keep in mind that the directory has to be owned by root so you need to create a subdirectory for the user to be able to write anything. –  TheFiddlerWins Aug 19 '13 at 14:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.