i have a linode and i access via ssh throw terminal. I need to create an sftp user which his default directory (and the only he can acces) is /var/www/xxxxxx.com/public_html/directory
Now, i did it, but when i try to connect i get broken pipe or connection rejected by peer
what i did is this:
Code:
$ adduser --home /var/www/xxxxxx.com/public_html/directory/ username
$ chown username:username /var/www/xxxxxx.com/public_html/directory/
$ chmod 755 /var/www/xxxxxx.com/public_html/directory/
$ nano /etc/ssh/sshd_config
In /etc/ssh/sshd_config add following lines
Code:
Match User username
ChrootDirectory /var/www/xxxxxx.com/public_html/directory/
AllowTCPForwarding no
X11Forwarding no
ForceCommand internal-sftp
What im doing wrong?