-   Linux - Newbie (
-   -   PLease god help me! (

reesee 01-27-2004 04:23 PM

PLease god help me!
Ok, I will make this as easy as I can.

I am running Mandrake 9.2 / Gnome 2.4. As a test I've set up apache2 on my /d2 drive. It set up fine, and started fine, but when I go into the folder it's locked. If I try to do anything I am told I am not the owner. I have opened a shell and cd'd into the folder and did the su thing, but that didn't help. I have tried everything I know to get myself in there with the proper permissions, please help me i'm dumb! :cry:

qwijibow 01-27-2004 05:23 PM

lol... im not god, but i will have a go.

OK.. become super user
chown -R [the username u want to own that folder] [the path of the folder that is locked]

-R means recursive, so all files and folder within that folder will be changed too.

now u may need to edit permissions

chmod ABC -R [The foder you want to change access rights to]

remove the -R if u dont want it to alse effect all sub-directories.

and where A is the number code of access right for the OWNER
B is access rights number for those users in same group as OWNER
and C is accress rights number for every one else.

Access Number Code 4 = Read Only

Access Number Code 5 = Read and Execute

Access Number Code 6 = Read and WRITE

Access Number Code 7 = Read Write AND EXECUTE.

a common combination is 755.

you understand ?

reesee 01-27-2004 06:55 PM

I understand, and it worked. Thanks alot qwijibow. :)

SciYro 01-27-2004 07:35 PM

755 is standard?, i mean, i dont think executing a directory is a good thing right?

Shade 01-27-2004 07:47 PM

755 is "common" for directories and files meant for public access. Allows scripts to be run, webpages read, changing of directories, files to be executed, etc -- how would you execute a directory?

755= read write execute for owner, read/execute for group members, read/execute for others. Looks like this for a file in long desc -- -rwxr-x-r-x

Not a bad thing really.
So long as write permission isn't granted to everyone, there shouldn't be problems :-D

SciYro 01-27-2004 08:13 PM

hmm i alsawy thought exectute was given for programs and scripts only, regular files(folders dircectoryies, whatnot) just read write, at elast that how i thinki i did it?

reesee 01-27-2004 08:26 PM

I can tell you one thing, I am never going back to windows. I really like linux, it's well worth the pain of getting to know how to run it. I plan on using /d2 for a server in the future, am I going to have to change permissions for each file to protect them? or will 755 do it?

frob23 01-27-2004 08:39 PM

Directories MUST executable!!! If they are not you will not be able to access anything in them. You can turn off the x bit for people you don't want snooping in them but for Eris' sake LEAVE it on at least for yourself!

Thymox 01-27-2004 10:13 PM


Originally posted by SciYro
hmm i alsawy thought exectute was given for programs and scripts only, regular files(folders dircectoryies, whatnot) just read write, at elast that how i thinki i did it?
Yeah, but for files that are not scripts, will being executable make any difference to them? Surely it is easier to have the default setting as 755 rather than having to manually set the permissions for each file just to make sure than an image isn't executable when in reality, an executable image is not a real problem :D

qwijibow 01-28-2004 07:56 AM

the execute permission is used for stopping executables being ran by certain users (non root users cant execute iptables for example)

if you set a non executable file to executable access rights, all that will happen is an attempts to execute it will be greeted with a "cannon execute file blah blah blah"

here is what i use.....

700 (owned by me) for my home directory
700 (owned by root) for root only things (everything in /sbin /usr/sbin /usr/local/sbin(
755 (owned by root) for everything else (involving average programs 4 every1 to execute)

ohh and yes.....
for folders... the execute permission allows people to cd into that directory, i learned that lesson when with telnet , i made my /home/me directory on my remote university unix account NOT executable, even by myself (cos u cant execute directory's anyway right... lol) 3 hours before my coursework (on that server) was due to be habded in !!!

SciYro 01-28-2004 08:14 AM

lol, well ill remeber that, but as far as needing stuff like /sbin as root only, i ahve no need snece linux i use on laptop only (like 8 years old but i got it for a good deal so i can learn how to install and get linux running so when i do somday get a desktiop ill know what to do :)) and im the only usuer (the bios passrd at boot time makes sure this ahppens :), cuse i 4got to install shadow passwrds (didnet think id need them, now i want to sue them to see how it works just forfun, ud think utils like shadow u could get the source from anyware!, but noo!, only a few websites that giv it in .tar.gz and not .rpm (ew), and thsoe are all ftp sites! (my win box that is for the "faimly" comuter (no wonder y they wont let me try to install linux on it :) ) and it cant get ftp (IE wont work and neither will any client, im thinking somone blocked port 21 but i cant find out how to find out in windows ) neways back to whatever usless point i was making, 2nd thought y was i posting here?

reesee 01-28-2004 10:26 AM

Well I am the only user on this machine that will use it. So let me get this right, If I have files and folders in a directory that is accessible via the web everything will be ok?. I'm sure I will have to change permissions for some files.

frob23 01-28-2004 03:57 PM

Those files, that are world readable and are accessable from the web will be open to everyone.

Also, I would not recommend leaving normal text files as executable. Chances are slim that it would really affect you but if it did you could really trash some stuff. There are just too many ways for it to cause problems. Only make stuff executable if it needs to be... like dirs and programs.

All times are GMT -5. The time now is 09:03 PM.