0

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

and

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
  • 1
    Did you log in after adding yourself to sftpaccess ? The changes will not apply to shells already running at the time you changed group membership. – user4556274 Dec 29 '16 at 13:48
  • please log out and log in again to see changes take effect. – George Udosen Dec 29 '16 at 13:51
  • Oh my gosh i'm and idiot. Thank you user4556274, forgive me I just started using linux like 2 weeks ago. Need more coffee. TYTY... – Seth Stenzel Dec 29 '16 at 13:51
1

These awesome folks answered the question in comments. Thanks guys.

Did you log in after adding yourself to sftpaccess ? The changes will not apply to shells already running at the time you changed group membership. – user4556274 4 mins ago

please log out and log in again to see changes take effect. – George 1 min ago

  • Wont let me close for 2 days it says. Thanks again guys. – Seth Stenzel Dec 29 '16 at 13:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.