I'm trying to set a small webserver for personal use. I have a fodler /srv/http/cgi-bin/
which I want to edit as user and not superuser. I tried to chmod it as mentioned here. Here is the result:
sudo chmod 755 /srv/http/cgi-bin/ -R
[yotam@myhost ~]$ echo "h" >> /srv/http/cgi-bin/h.py
bash: /srv/http/cgi-bin/h.py: Permission denied
Edit:
Here is some data due to the comments and answers:
[yotam@myhost ~]$ sudo chmod 760 -R /srv/http/cgi-bin
Password:
[yotam@myhost ~]$ echo "hh" >> /srv/http/cgi-bin/h.py
bash: /srv/http/cgi-bin/h.py: Permission denied
[yotam@myhost ~]$ ls -ld /srv/http/cgi-bin
drwxrw---- 2 root root 4096 May 20 15:54 /srv/http/cgi-bin
Also, the server is Ubuntu desktop running apache2. As far as I can tell, I didn't temper with any of the user settings so it all should be the default parameters
ls -ld /srv/http/cgi-bin
andls -l /srv/http/cgi-bin/h.py
and paste the result. You probbaly have the-R
flag in the wrong place. It needs to come first.sudo chmod
works fine; but it grants the owner (apparentlyroot
) write permission, not you. It's not clear how exactly to solve this; my suggestion would be to copy the file, edit the cooy, usesudo
to replace the original with your edited version.