I have my sftp users chrooted into /var/www and I would like for them to be automatically moved into their directory. I found this answer which helped me a lot: Chroot SFTP - Possible to allow user to write to current (chroot) directory. But I want to move the user into his or her home directory (=/= name of the user) instead (which is a sub-dir of var/www). I tried:
Match Group sftpusers
X11Forwarding no
AllowTcpForwarding no
ChrootDirectory /var/www
ForceCommand internal-sftp -d %h
But I get fatal: percent_expand: unknown key %h [postauth]
.
EDIT: I found that %d
is the user directory but it doesn't seem to work because it is looking for it based on /var/www.