By enzovecchio
Hello So, now I have this problem… I’m able to create a new user and change it’s home folder to where I want:
adduser --no-create-home username
chown username:username /var/www/html/
usermod --home /var/www/html/ username
But now how can I limit this user to see/write only in its home directory (/var/www/html/) and not go above this directory via ftp? Right now the user is able to see everything. Anyone has any ideia? I was not able to find an answear for this using openssh-sftp. I’m using ubuntu 14.04, btw.
Thank you!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
This comment has been deleted
To limit an SFTP user to their home directory, you can edit /etc/ssh/sshd_config to include:
Match User username
ChrootDirectory %h
AllowTCPForwarding no
X11Forwarding no
ForceCommand internal-sftp
Then restart ssh:
service ssh restart
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.