Is there any method, with ChrootDirectory and internal-sftp, to automatically cd to a subdir on login?

Ángel González keisial at gmail.com
Thu May 17 07:13:20 EST 2012


Peter Stuge wrote:
> Whit Blauvelt wrote:
>> in my case the ChrootDirectory is %h and the place the users need
>> to end up is %h/files.
> You can obviously not use the home directory to identify the chroot
> if you want to use it for chdiring. You can probably quite easily
> configure the correct path for chrooting without using the home
> directory, and instead set the home directory to /files for the
> relevant users to get exactly what you want.
>
>
>> This is trivial to do with scponly. Just set the home directory in
>> /etc/passwd to be /home/user1//files
> Sorry, but that is a mindbogglingly bad idea. It is overloading a
> case where there is already absolutely well-defined behavior. Of
> course it may work, but it may also fail completely in the face of
> less typical circumstances. It's neither smart nor elegant to try to
> create some conflicting standard where there is already one.
If the user folder is /home/username, just change the

ChrootDirectory to /home/%u, and then make their home /home/user1/files




More information about the openssh-unix-dev mailing list