Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Currently setting up a Centos6.4 box and are wanting to jail sftp users upon login. I've been following the notes here 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

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
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


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.