sftp chroot on FreeBSD

Filesharing with chrooted SFTP
sftp/scp chroot solution?
How to Set Up an SFTP User on FreeBSD
SFTP chroot jail/access based on wildcard

[...]
Match User jon
        ChrootDirectory    /web/example.com/jon
        X11Forwarding      no
        AllowTcpForwarding no
        ForceCommand       internal-sftp
Dec 19 15:25:15 example.com sshd[78707]: Accepted keyboard-interactive/pam for jon from 10.0.0.5 port 62601 ssh2
Dec 19 15:25:15 example.com sshd[78710]: fatal: bad ownership or modes for chroot directory component "/web/"
$ pw user add jon
$ tail /var/log/auth.log
$ chown root /web
$ chown root /web/example.com
$ chown root /web/example.com/jon
$ ssh jon@example.com
Password for jon@example.com:
Could not chdir to home directory /web/example.com/jon: No such file or directory
This service allows sftp connections only.
Connection to example.com: closed.

Leave a Reply

Your email address will not be published. Required fields are marked *