Web Hosting Talk







View Full Version : chmod this


fatbargains
06-01-2002, 03:39 PM
how do i chmod 777 all the files in current folder and all the files in other sub directories w/out manually chmod individual files?

i have a lot of files in the cgi bin to chmod 777 and a lot more in other sub-sub cateogries... is there a way or a program to chmod the cgi-bin and it automatically chmod all files and folders in it? i dont have access to shell. Thanks.

kindred
06-01-2002, 03:44 PM
use -R flag for recursion, i.e.:

chmod -R 777 *

would set all files to -rwxrwxrwx in the current directory, and all sub-directories.

You sure you want 777 on all those files? Thats usually a VERY insecure mode, especially with cgi-bin files. Maybe you could do with 655 (-rwxr-x-r-x) so that everyone can still execute the files, but everyone at least can't edit or write to them.

Andy.

Edit: heh just saw the very last few words of your post - that you don't have access to the shell :)

Wouldn't a unix ftp client still be able to chmod? if the server has the ability to chmod, then you might be still able to issue that command via an ftp client. if you don't have ftp, then you're buggered.

fatbargains
06-01-2002, 03:46 PM
i dont have access to SHELL, unfortunately -- is there other way(s) to do it?

fatbargains
06-01-2002, 03:53 PM
i'm ftping using WS_FTP LE on windows xp machine. my account is on a Unix host. everytime i want to chmod files, i have to select individual and chmod them. this time, there are a lot of files to chmod... GRRRH

viGeek
06-01-2002, 04:25 PM
on WS_FTP

Hold {shift} and hit the down key, it will highlight every file in that perticular directory. Then Chmod the files, and it will do each one.

HTH

fatbargains
06-01-2002, 04:29 PM
yeah that'll work only for one category at a time.. i have a lot of sub categories. anyways



another question, when i chmod my cgi-bin to 777, and access it
domain.com/cgi-bin

i got this error


Forbidden
You don't have permission to access /cgi-bin/ on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.


--------------------------------------------------------------------------------




why so? even i did chmod 777 it!

samething for the cgi files in there.. can't access them.

for the cgi files


---------------
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@yourserver.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

davidb
06-01-2002, 05:13 PM
couldnt u make a small perl script and have it run the command

cperciva
06-01-2002, 05:17 PM
Don't do that.

xerocity.com
06-01-2002, 05:20 PM
For security reasons the cgi-bin should never display a directory listing. But what you want to do is possible. You can do it with a .htaccess file. To do this, place "Options ExecCGI Indexes Includes FollowSymLinks" in a .htaccess file in your cgi-bin, or in your main html folder if you want to allow it in all directories.

"couldnt u make a small perl script and have it run the command". yes, you can do this with a perl script.

roly
06-01-2002, 08:58 PM
In WS_FTP LE:

Right click some of the files (it dun matter which one)
Select FTP Commands > SITE
In the box that pops up type: chmod -R 777 *
Click ok

Chas
06-01-2002, 10:11 PM
Originally posted by fatbargains
why so? even i did chmod 777 it!

samething for the cgi files in there.. can't access them.


Your server most likely has suEXEC enabled. That will prevent scripts that are set to 777 (or in a directory set to 777) from executing. At the most you should set them to 775 and 755 would be better. Is there a specific reasin you are trying to set them at 777?

You can create a perl script to set permission for you but this is something that you will want to upload and use then remove it from the server as soon as you are done with it.

Regards,
Charlie

jahsh
06-03-2002, 06:23 PM
why would you want them set to 777 anyway...try 755.