![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Jan 2001
Posts: 3,539
|
755 or 775 directories?
CuteFTP defaults to 755 directories when you upload, and CuteFTP Pro defaults to 775. Why 775?
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Join Date: Feb 2002
Location: Seattle
Posts: 1,070
|
depends on your host. some hosts give you a group with your username, others have a shared group across all users (if virtual hosting).
go with 755 if you can, it's the "safer" of the two, but there is a chance it doesn't matter.
__________________
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Join Date: Dec 2001
Location: Malibu
Posts: 3,817
|
Well, I guess there is more than 1 reason to use 775 instead of 755.
Anyway, lets say you have a script which writes a file to a directory. Your FTP is probably running on a different group than your webserver is. If so, it's possible that on some servers the script won't be able to write to the directory if you run it from a browser. Now you could either chmod this directory to 777 to make it writeable or you can 'chown ftpuser:nobody' this directory, if your ftp is running from ftpuser and webserver is nobody, and then chmod it to 775 and it will be writeable without having to chmod it to 777. And 775 is saver than 777. :-) |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Jan 2001
Posts: 3,539
|
I just found a 755 directory and "nobody" has the ability to read and write to the data files inside of it. So is 777 ever necessary? It does not seem necessary for me, anyway.
BTW, how is this possible when the last "5" in 755 means read and execute (no write)? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: Jan 2001
Posts: 3,539
|
Can a script read and write a file with "6" permission instead of "7" (with read and write instead of read, write, and execute)?
In other words, what is the execute bit used for? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Join Date: Jan 2001
Posts: 3,539
|
bump (I edited some posts above).
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 | |
Confirmed User
Join Date: Jul 2002
Location: Magrathea
Posts: 6,493
|
Quote:
The bits are "owner", "group", "other", so if only the first write bit is set, and nobody can write to it, the owner must be nobody. Edit: Although, that does seem a bit odd. "Nobody" owns directories on your server? SpaceAce |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 | |
Confirmed User
Join Date: Dec 2001
Location: Malibu
Posts: 3,817
|
Quote:
I would avoid 777 as much as possible, and use the chown with 775 option like i gave above instead, if it will work the same as 777. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | |
Confirmed User
Join Date: Dec 2001
Location: Malibu
Posts: 3,817
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 | |
Confirmed User
Join Date: Aug 2001
Location: New Orleans
Posts: 1,680
|
Quote:
To answer your question, yes a program can read and write any file with a permission of 0##6 (leading "0" designates Octal Notation. "#" can be any octal number). However, if it was in a directory with permissions that are any even number (which is what happens when the execute bit for "other" is not set to 1), you're going to have problems...
__________________
<CENTER><A HREF="http://www.hot-off-bourbon.com/" target="_blank"><IMG SRC="http://www.hot-off-bourbon.com/images/hob-logosmall.jpg" border="0"></A> <FONT face="Comic Sans MS" SIZE="-1"><I>Mardi Gras, Spring Break, Wet-T, Night Club Action, UpSkirt, Oil Wrestling, Voyeur</I></FONT></CENTER> |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 | |
Confirmed User
Join Date: Jan 2001
Posts: 3,539
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 | |
Confirmed User
Join Date: Jan 2001
Posts: 3,539
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
Confirmed User
Join Date: Jan 2001
Posts: 3,539
|
fiveyes, Thanks. Tell me if I got it right:
- the 'other' execute bit of a directory has to be on for reading and writing in that directory. - the 'other' execute bit of a file does not matter for reading and writing (only the read/write bits matter). ...so what does an execute have to do with in a file (beside for the x-bit-hack that makes the server parse the html as shtml)? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
Confirmed User
Join Date: Feb 2002
Posts: 1,751
|
Server side change on the ftp server
umask 022
__________________
<a href="http://www.jupiterhosting.com"><img src="http://www.jupiterhosting.com/banners/55x55.jupiter.gif" alt="" border="0" align=""></a> |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 | |
Confirmed User
Join Date: Jan 2001
Posts: 3,539
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 | |
Confirmed User
Join Date: Jul 2002
Location: Magrathea
Posts: 6,493
|
Quote:
If nobody isn't the owner and the owner is the only person with write access... SpaceAce |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 |
Confirmed User
Join Date: May 2001
Location: ICQ: 25285313
Posts: 993
|
SpaceAce,
You forgot about suexec. I know we use it, and I'm guessing a few other hosts do as well. It allows scripts to be ran under a differnent userid than the apache server is run as. It is configurable per virtual host, so we obviously have everyones script run as them (their FTP login). Much more secure, for obvious reasons. It is very possible suexec is being ran in his case. Try chmod'ing something to 777 and see if you get a 500 server error. Suexec will refuse to run on world writeable directories/files. So yes, it does give us a bit more of a support problem when people read the directions in script X's readme to chmod stuf 0777. Ugh. Too bad PHP cannot emulate this behaviour somehow. ![]() ![]() -Phil |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#18 | |||
Confirmed User
Join Date: Aug 2001
Location: New Orleans
Posts: 1,680
|
Quote:
Quote:
Quote:
__________________
<CENTER><A HREF="http://www.hot-off-bourbon.com/" target="_blank"><IMG SRC="http://www.hot-off-bourbon.com/images/hob-logosmall.jpg" border="0"></A> <FONT face="Comic Sans MS" SIZE="-1"><I>Mardi Gras, Spring Break, Wet-T, Night Club Action, UpSkirt, Oil Wrestling, Voyeur</I></FONT></CENTER> |
|||
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#19 |
Confirmed User
Join Date: May 2002
Location: Southern California
Posts: 122
|
Quite possibly the most useful thread I've seen here today. Thanks!
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#20 |
Confirmed User
Join Date: Jan 2001
Posts: 3,539
|
SpaceAce, Phil21,
I'm not using suexec nor do the scripts have root privileges... I'm going to dive into this and see what I can find out. This is bugging me now. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#21 |
Confirmed User
Join Date: Jan 2001
Posts: 3,539
|
Ok, here's my full details:
- some scripts are run as "nobody" via cronjobs (set manually) - some scripts and run as "nobody" via web browsers (set by default). - all the scripts read and write the same files with 666 permissions (666 = full read and write for all, no execute for anyone) - the directory containing these files has 775 permissions (775 = full read/write/execute for all except no write for public.) - all directories above that have 775 permissions also - all files have user and group "hq" - all directories have user and group "hq" - user and group "hq" has no special permissions what-so-ever. Does that make sense? Is it ok? I guess the directories do not need to have public write ability? If so, then CuteFTP's default 755 (775 = full read/write/execute for all except no write for group or public.) should work just as well as CuteFTP Pro's default 775. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#22 |
Confirmed User
Join Date: Feb 2001
Posts: 108
|
Hello,
Yes, these settings are correct. A directory should only be chmod'd to 777 if any script has to be able to create files in that directory. If it's chmod'd to 755 all scripts will be able to read/write to existing files in that directory, provided the files are chmod'd to 666 for write access. Thanks, Gernot |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#23 | |
Confirmed User
Join Date: Jan 2001
Posts: 3,539
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |