Wesley <[email protected]> wrote:
Thank you very much for your explanation. I understand better.
I finally use sftp using this in the file /etc/ssh/sshd_config :
...
Match User site1
ChrootDirectory /var/www/htdocs/website1
ForceCommand internal-sftp
PasswordAuthentication yes
Match User site2
ChrootDirectory /var/www/htdocs/website2
ForceCommand internal-sftp
PasswordAuthentication yes
--EOF
Here, otoh, %u works... meaning you could even do:
Match Group sites
ChrootDirectory /var/www/htdocs/web%u
ForceCommand internal-sftp
PasswordAuthentication yes
and while at it, don't forget to disable X, agent and TCP forwarding,
should it be enabled.
Another thing worth noting is that the ChrootDirectory target may be a
symlink, if one or more "sftp roots" differs from the rest.
And in each chroot there's a folder 'site'.
Your method using ftpd is easiest to achieve the goal, i will probably
apply it later.
I'd say the above is by far the easiest.
/Alexander