Question

Permissions on /var/www/html for uploading web site files via SFTP

Hi,

I’ve installed nginx successfully on an Ubuntu instance here at DigitalOcean. The index.html page (in /var/www/html) displays appropriately: “Welcome to nginx on Debian.”

Now I want to upload some files via Cyberduck (sftp) to “duplicate” my current web site currently hosted elsewhere: chestradiologists.org

But I cannot because I don’t have the appropriate permissions. (I created a new user with sudo permissions after I created the Ubuntu VPS.)

Via Cyberduck, I see the following for /var/www/html (all these directories):

rwxr-xr-x (755)

        Read      Write     Execute

Owner Y Y Y Group Y No Y Others Y No Y

Owner 0 Group 0

I’m the only user that will upload files I create with Octopress on my Mac.

How do I change the ownership/permissions to best accomplish this ?

I have a rudimentary understanding of Unix permissions :-(

So, please explain with some detail if possible.

Thanks!

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Update: the following seems to have worked:

  1. Establish a [new directory] at /var/www

  2. Change the directory owner and group: sudo chown www-data:www-data /var/www/[new directory]

  3. allow the group to write to the directory with appropriate permissions: sudo chmod -R 775 /var/www

  4. Add myself to the www-data group: sudo usermod -a -G www-data [my username]

Logout and login again.

Thanks.

Howard

Update: the following seems to have worked:

  1. Establish a [new directory] at /var/www

  2. Change the directory owner and group: sudo chown www-data:www-data /var/www/[new directory]

  3. allow the group to write to the directory with appropriate permissions: sudo chmod -R 775 /var/www

  4. Add myself to the www-data group: sudo usermod -a -G www-data [my username]

Logout and login again.

Thanks.

Howard

Update: the following seems to have worked:

  1. Establish a [new directory] at /var/www

  2. Change the directory owner and group: sudo chown www-data:www-data /var/www/[new directory]

  3. allow the group to write to the directory with appropriate permissions: sudo chmod -R 775 /var/www

  4. Add myself to the www-data group: sudo usermod -a -G www-data [my username]

Logout and login again.

Thanks.

Howard

Update: the following seems to have worked:

  1. Establish a [new directory] at /var/www

  2. Change the directory owner and group: sudo chown www-data:www-data /var/www/[new directory]

  3. allow the group to write to the directory with appropriate permissions: sudo chmod -R 775 /var/www

  4. Add myself to the www-data group: sudo usermod -a -G www-data [my username]

Logout and login again.

Thanks.

Howard

Update: the following seems to have worked:

  1. Establish a [new directory] at /var/www

  2. Change the directory owner and group: sudo chown www-data:www-data /var/www/[new directory]

  3. allow the group to write to the directory with appropriate permissions: sudo chmod -R 775 /var/www

  4. Add myself to the www-data group: sudo usermod -a -G www-data [my username]

Logout and login again.

Thanks.

Howard

Update: the following seems to have worked:

  1. Establish a [new directory] at /var/www

  2. Change the directory owner and group: sudo chown www-data:www-data /var/www/[new directory]

  3. allow the group to write to the directory with appropriate permissions: sudo chmod -R 775 /var/www

  4. Add myself to the www-data group: sudo usermod -a -G www-data [my username]

Logout and login again.

Thanks.

Howard

Update: the following seems to have worked:

  1. Establish a [new directory] at /var/www

  2. Change the directory owner and group: sudo chown www-data:www-data /var/www/[new directory]

  3. allow the group to write to the directory with appropriate permissions: sudo chmod -R 775 /var/www

  4. Add myself to the www-data group: sudo usermod -a -G www-data [my username]

Logout and login again.

Thanks.

Howard

Update: the following seems to have worked:

  1. Establish a [new directory] at /var/www

  2. Change the directory owner and group: sudo chown www-data:www-data /var/www/[new directory]

  3. allow the group to write to the directory with appropriate permissions: sudo chmod -R 775 /var/www

  4. Add myself to the www-data group: sudo usermod -a -G www-data [my username]

Logout and login again.

Thanks.

Howard

Update: the following seems to have worked:

  1. Establish a [new directory] at /var/www

  2. Change the directory owner and group: sudo chown www-data:www-data /var/www/[new directory]

  3. allow the group to write to the directory with appropriate permissions: sudo chmod -R 775 /var/www

  4. Add myself to the www-data group: sudo usermod -a -G www-data [my username]

Logout and login again.

Thanks.

Howard

Update: the following seems to have worked:

  1. Establish a [new directory] at /var/www

  2. Change the directory owner and group: sudo chown www-data:www-data /var/www/[new directory]

  3. allow the group to write to the directory with appropriate permissions: sudo chmod -R 775 /var/www

  4. Add myself to the www-data group: sudo usermod -a -G www-data [my username]

Logout and login again.

Thanks.

Howard