Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

CHMOD -R 777 or CHMOD -R 755

AldebaronAldebaron New
edited November 2018 in Vanilla 2.0 - 2.8

Hello everyone,
New installation
I would like to know the chmod (number) permission to put when installing the forum on a remote server and not local test server.

Confirm the cache, conf, and uploads folders are writable by PHP.

What that mean?
I need to put 777 or 755?
Recursion or not: **-R **or only the folder?
like: chmod -R 777 or chmod -R 755?
chmod 777 or chmod 755 just the folder only?

Thank you very much for your answer
Best regards

Comments

  • never ever do 777 on web files. chmod 777 is pretty much never needed. It has been encouraged by cheap old school shared hosts, becuase they provide little in the way of server management. But is bad practice and lazy.

    Permission actually largely depend on setup, there is no one size fits all. Firstly you need to know the web process user (or in some cases the user assign to run the CGI). Assign that user to he writeable folders only. Then generally 775 is more than sufficient.

    grep is your friend.

  • AldebaronAldebaron New
    edited November 2018

    Super merci "Shifu", with your response i must put this 3 folders with 775 permission chmod.
    cache, conf, uploads.
    But the last question: recursively or not for the folder and files?
    chmod -R 775
    chmod 775

    Best regards

  • techically the process user needs to be able to write to conf/config.php the other file in conf there is no reason to give write permissions. So it is the folder plus that file. The others recursively.

    like I say you need to know the process user. often www-data, but could be anything.

    grep is your friend.

  • @Aldebaron said:
    cache, conf, uploads.
    But the last question: recursively or not for the folder and files?
    chmod -R 775
    chmod 775

    Adding to @x00 ... No. Only directories need be executable.

  • AldebaronAldebaron New
    edited November 2018

    Youpi!!! Thank you all for your response

    resume:
    cache, conf, uploads: chmod 775 only folders

    I realy appreciate
    thank

  • x00x00 MVP
    edited November 2018

    donovanb is making a distinction between executable and writeable. Pre existing file don't need to be executable.

    The order is of the numbers is user then group then others

    # Permission rwx Binary
    7 read, write and execute rwx 111
    6 read and write rw- 110
    5 read and execute r-x 101
    4 read only r-- 100
    3 write and execute -wx 011
    2 write only -w- 010
    1 execute only --x 001
    0 none --- 000

    The long of the short is you should know/assign the user an group before considering permissions otherwise you could be making a misstep.

    If you your host doen't allow this (e.g ftp only site), you are wasting your time with that host. Now you can get cheap servers you can ssh to.

    grep is your friend.

  • AldebaronAldebaron New
    edited November 2018

    Hello x00
    Thank you for your quick reply.
    In fact I'm about to give up this permission story that confuses me. The ftp software that I use allows me to put the permission
    Cyberduck, Transmit
    either by checking or by putting numbers.
    Me who is a bit noob and who asks to learn. It looks like a Gordian knot or kafka book.
    Do you have a simple answer for me?
    What do I do with these folders and files?
    With numbers if possible. I thank you a thousand times in advance for your help.
    for now I understood that it was necessary to put the file only in reading and writing
    775
    and especially not recursively -R 775
    thank you very much in advance
    Best regards

  • normal ftp is not goign to set the user or group. Server management comes with a learning curve.

    grep is your friend.

  • good evening x00
    Thank you for your answer, so what do you advise me to do?
    Because for me there I am in confusion. I do not understand anything anymore.
    Confirm the cache, conf, and uploads folders are writable by PHP
    I have a shared server that does not allow me too much use of ssh.
    I will probably use an ftp software as mentioned above.
    What do you advise me for the beginner that I am
    I'm just used to wordpres and drupal right now and I have not had that kind of difficulty.
    Thank you shifu
    Best regards

  • Be as restrictive as possible:

    Start with 755
    If that doesn't work use 775
    If even that is not enough you must use 777 (and consider changing the hosting service)

    Using FileZilla or any FTP client is fine if your only option is chmod (and not chown)

  • Hello
    Thank you for your kindness,
    I will follow this explain.
    Start with 755
    If that doesn't work use 775

    Best regards

Sign In or Register to comment.