Answer the question
In order to leave comments, you need to log in
How to configure SFTP to /var/www/mydomain.ru site?
Given:
VDS with 5 sites.
Task:
give rwX access via SFTP for the user myuser to /var/www/mydomain.ru and prevent it from getting out of this folder.
It was done:
1. a user was created
useradd myuser -g www-data -d /var/www/mydomain.ru -s /bin/false
mkdir /var/www/mydomain.ru
chown root:root /var/www
chmod 770 /var/www
chown mouser:www-data /var/www/mydomain.ru
chmod 775 /var/www/mydomain.ru
nano /etc/ssh/sshd_config
Subsystem sftp internal-sftp
Match Group sftp
ChrootDirectory %h
ForceCommand internal-sftp
AllowTcpForwarding no
service ssh restart && service apache2 graceful
Answer the question
In order to leave comments, you need to log in
Do not worry, the same proftpd supports working in sftp mode, you can lock the hamster inside with one line in the config. Here is an example setup https://www.digitalocean.com/community/tutorials/h...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question