So I'm on a VPS - CentOS Linux installation. I have vsFTPd on the server. I currently have SFTP access to the server via my root user, but am now trying to create a new user with FTP access to a specific directory only on the server, I've done the following:
1. mkdir /var/www/mydomain.com 2. mkdir /var/www/mydomain.com/html 3. useradd <-username> 4. passwrd <-username> 5. chown –R <-username> /var/www/mydomain.com 5. groupadd <-groupname> 6. gpasswd -a <-username> <-groupname> 7. chgrp -R <-groupname> /var/www/mydomain.com 8. chmod -R g+rw /var/www/mydomain.com
What I'm struggling to do is to create the user to ONLY have access to
/var/www/mydomain.com - I experience that the user correctly logs into the wished folder, HOWEVER I can then browse "back" to other directories. I want the user to stick in the specific folder and not being able to "browse" back.
I've found different articles on chrooting, but simply haven't figured it out to use it in the steps included above.