4

sudo chmod -R 777 /opt/lampp/htdocs

output is

chmod: changing permissions of .... Operation not permitted

I want to give every permission to htdocs and all its sub-folders and to every file on all the sub-folders .

Thanks

7
  • 1
    Try sudo chmod -R a+rwx /opt/lampp/htdocs
    – 0x2b3bfa0
    Mar 16 '15 at 15:37
  • Why would you want to that?
    – Elder Geek
    Mar 16 '15 at 15:40
  • Not working @Helio & Elder Not everything got the permissions , I copied my project folder to htdocs where it should be . Now not all the files are loading . I want to give every permission to htdocs . read write execute delete .
    – Gammer
    Mar 16 '15 at 15:44
  • Try this: sudo su and then type your original command in the root prompt.
    – 0x2b3bfa0
    Mar 16 '15 at 16:02
  • 1
    @sangharsh: I think that this dirty hack doesn't deserve to be an answer. If it worked for you, simply upvote the comment to give it more visibility. However, if do you find my comment so interesting, make a answer by yourself with the command. Then notify me and I'll upvote. ;-)
    – 0x2b3bfa0
    Oct 6 '15 at 18:25
1

I'd rather recomment you to have different permissions for directories and files, because you'll need to run some commands inside of directory (like ls, cp, cat etc.), and they require "executable" permission.

At the same time I strongly recommend you to add "executable" bit only to that files, that should be executable - some scripts, commands, etc.

You may use the following scheme to set permissions on files&directories separately:

sudo find . -type d -exec chmod 775 {} \;

for directories

sudo find . -type f -exec chmod 664 {} \;

for files,

Instead of ‘.’ you may use the full path to needed file or directory. 775 & 664 - are binary-written permissions. More information about them you may receive there - http://linuxcommand.org/lts0070.php

If you'd like to provide full permissions on files and directories, you may perform the following:

sudo find /opt/lampp/htdocs -type d -exec chmod 777 {} \;

for directories

sudo find /opt/lampp/htdocs -type f -exec chmod 666 {} \;

for files.

Also take care about owner:group_owner parameters, they're also important for you.

3
  • Still not working Bro
    – Gammer
    Mar 16 '15 at 16:14
  • Show us the output of: sudo ls -lsa /opt/lampp/htdocs please Mar 16 '15 at 16:15
  • output : total 72 4 drwxrwxrwx 7 755 www-data 4096 مارچ 13 01:56 . 4 drwxr-xr-x 30 root root 4096 مارچ 12 18:32 .. 4 -rw-rw-rw- 1 755 www-data 1441 نومبر 12 20:49 applications.html 4 -rw-rw-rw- 1 755 www-data 2142 اپريل 29 2013 bitnami.css 4 drwxrwxrwx 20 755 www-data 4096 مارچ 12 18:25 dashboard 4 drwxrwxrwx 2 755 www-data 4096 مارچ 12 18:24 img 4 -rw-rw-rw- 1 755 www-data 256 فروري 6 2009 index.php 4 drwxrwxrwx 12 755 www-data 4096 مارچ 12 18:08 shuffle_source
    – Gammer
    Mar 16 '15 at 16:41

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.