I'm fairly new to Ubuntu so forgive me if I'm missing something obvious. After finding out that my webhost allows incoming traffic on port 80 and 443, I decided I'd try setting up my own wordpress site. I'm using Ubutu server 16.04lts. The site is up and running and I can access it.
I'm now trying to get SFTP set up but I'm getting a bit confused with folder permissions.
I created a group sftpaccess and added my account to it. I then changed the ownership on the /var/www the webhost folder with the following command:
chown root:sftpaccess /var/www
I then also changed the permission on it again with:
chmod 770 /var/www
chmod g+s /var/www
But after doing so I cannot access the folder with a user in the sftpaccess group getting a permissions denied error.
If I change chmod 770 to 775 I can access the folder. My question is why, from what I'm reading the last digits place is for the "world" and being part of the group with 7 should give me access correct? My user being in sftpaccess should let him view the folder shouldn't it?
Sorry if this is a really simple question. Here is my output.
thearchitect@ubuntu-lampstack:/var$ cd www -bash: cd: www: Permission denied thearchitect@ubuntu-lampstack:/var$ ls -ld www drwxrws--- 3 root sftpaccess 4096 Dec 27 21:20 www thearchitect@ubuntu-lampstack:/var$ groups thearchitect thearchitect : thearchitect adm cdrom sudo dip plugdev lxd lpadmin sambashare sftpaccess sudo chmod 775 /var/www thearchitect@ubuntu-lampstack:/var$ cd www thearchitect@ubuntu-lampstack:/var/www$ thearchitect@ubuntu-lampstack:/var/www$ ls html