Essence: Create a user, with access via SFTP, with the inability to log out above its root folder.
Debian 6
Worth LAMP
Create user:
useradd -d /home/test1/ -b /home/test1/data -g www-data -s /bin/bash test1passwd test1 In sshd_conf:
Subsystem sftp internal-sftpMatch Group www-data AllowTCPForwarding no X11Forwarding no ChrootDirectory %h/data ForceCommand internal-sftp In the folder via SFTP enters. Above it does not go. But at the same time I can not create or change anything there, writes permission denied .
Then I do this:
chown -R test1:www-data /home/test1/data Now it does not go in. When trying to connect it writes:
Error: Server unexpectedly closed network connection
Error: Unable to connect to server
How to make that the user could enter and change everything in the folder? But not be able to exit it.