Portal Home > Knowledgebase > Articles Database > CHMOD


CHMOD




Posted by nabeelamjad, 04-07-2010, 07:26 PM
Hi , I just want to change all files and folders value to 777 but it seem hell alot of work becoz when i used cpanel for this purpose then after select all and change permission to 777 it wont changed all files and folder inside a directory how can i do that?

Posted by boxer, 04-07-2010, 07:47 PM
from the shell as root run this command if you need to chmod all the webfiles and folders simply run this command

Posted by shawn_linux, 04-08-2010, 07:29 AM
I would strongly suggest not to change permissions to 777 since this will make it world writable and any one can have access to all files and directories. If PHP is running as DSO I would suggest use 775 and not 777 in any case.

Posted by ServerSitters_Paul, 04-08-2010, 08:13 AM
The file manager doesn't provide you with the option to change the permissions recursively. Therefore, you would have to use SSH in order to make it recursive or you can request that your web host make the changes. They need to run the following: chmod -R 777 *

Posted by madaboutlinux, 04-08-2010, 09:04 AM
cPanel File Manager do not provide an option to change the permissions recursively. You need to change the permissions via SSH as stated earlier by other people here but make sure, you execute the command under the home directory of your server and not under /root SSH to your server (I am assuming you have root access), then where, username is the user of your account. If you are not the owner of the server, then normally hosting providers do not provide shell access so it's better you ask your host to change the permissions for you. Note: changing permissions to 777 will make them world-writable and it's easy to inject/hack your website.

Posted by Sileep Kumar M S, 04-08-2010, 09:24 AM
Using 777 permission is really a bad idea! Use the secure permissions instead. Use this command to change the file permission recursively Use this to change folder permission

Posted by energizedit, 04-08-2010, 09:39 AM
Agreed, changing to these permissions is a really bad security practice. What problem are you trying to fix exactly?

Posted by nabeelamjad, 04-09-2010, 03:44 AM
yah i know its really bad but for a special function i have to do it please just let me know how can i take there permission back , for example i wanna chmod all to 0777 and after completing my task i wanna revert it permission back to normal how should i proceed directory nam is public_html

Posted by madaboutlinux, 04-09-2010, 04:17 AM
Once you are done with the changes, just remove the write permissions of gruop and others. Execute the following to achieve that:

Posted by nabeelamjad, 04-09-2010, 04:59 AM
how should i chmod 0777 this folder

Posted by madaboutlinux, 04-09-2010, 05:11 AM
You can assign 777 permissions to your public_html using the following command but only 750 is needed in order for the website to be accessible (assuming the ownership is user:nobody)

Posted by Andant C Tyran, 04-09-2010, 05:25 AM
chmod -R 777 public_html to public_html and all folders in it.

Posted by nabeelamjad, 04-09-2010, 05:30 AM
ok fine thanks and for revert it i used the above command right?

Posted by madaboutlinux, 04-09-2010, 06:59 AM
Yes, to remove the write permissions of group and others, execute

Posted by ideamine, 04-09-2010, 05:00 PM
chmod -R 777 public_html But putting 777 permission on file and folders is major security threat.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read

Language: