0

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

Simon Bennett
  • 135
  • 1
  • 5

1 Answers1

0

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.

Simon Bennett
  • 135
  • 1
  • 5
  • 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