skip to Main Content

please can anyone help with a solution? am getting an error message that says permission denied anytime I try to upload files to my (LEMP) server using File Zila. I have tried changing the file permission in File Zilla to 777 but still does not work.

2

Answers


  1. if you have SFTP then follow below steps:

    sudo chmod -R o+rw /var/www/html    /* Location for  folder or file */
    
    chmod -R 755 /var/www/html/         /* Location for  folder or file */
    
    Login or Signup to reply.
  2. If you are trying to give the {user} as well as the www-data both access to the website directory try this

    //without {}

    sudo usermod -a -G www-data {userName}
    

    #This adds user to www-data group

    //set permissions for user group www-data

    sudo chgrp -R www-data /var/www/html
    

    //followed by

    sudo chmod -R g+w /var/www/html
    

    this will enable {user} to use SFTP with the FileZilla or other programs to read and write files in the directory without sudo

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search