manikandanar70
If you need to see and work with any files and any site you will be creating, then you just connect to your server as user www-data instead of root privileged user. Just create a password for user www-data and connect via FTP. You should be able to see all web files.
On the other hand, if you need to be able to create a new user who can only access certain site's files you will need to add a new user and group like so:
================================
- Create new user
sudo adduser user1
- Create new group with the name of subdomain
sudo addgroup site1
- Add user1 to the newly created group
sudo adduser user1 site1
- Add www-data to site1 group
sudo adduser www-data site1
- Check that user1 is really in that group,
groups user1
- Now we can change the group ownership of your intended directory.
sudo chown -vR :user1 /var/www/site1/htdocs
- Grant write permission to this new group owner,
sudo chmod -vR g+w /var/www/site1/htdocs
- Check that all the changes are indeed there
ls -ld /var/www/site1/
Remember to replace user1 and site1 with your own values.