chmod operation not permitted on /var/www/ SSH raspbian

10,498

You need to use sudo with chmod as well:

sudo chmod go-rwx /var/www
Share:
10,498

Related videos on Youtube

William
Author by

William

Updated on September 18, 2022

Comments

  • William
    William almost 2 years

    I am trying to setup a simple Apache web server over SSH in Raspbian but cannot obtain access to /var/www. I have tried these commands to obtain write permission:

    sudo chown -R www-data:www-data /var/www
    chmod go-rwx /var/www
    

    For chmod I got this error:

    chmod: changing permissions of ‘/var/www’: Operation not permitted
    

    For chown it didn't display any message, and appeared to do nothing. To recap, I am trying to figure out how to obtain access to use these commands and also to obtain access to that directory. I am logged in on the default user pi and haven't set a root password. Thanks in advance.

    • barlop
      barlop over 8 years
      what about sudo chmod.. And why does your example do sudo chown but not sudo chmod?