LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-27-2004, 03:23 PM   #1
reesee
Member
 
Registered: Jan 2004
Posts: 66

Rep: Reputation: 15
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!
 
Old 01-27-2004, 04:23 PM   #2
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
lol... im not god, but i will have a go.

OK.. become super user
su
[root-password]
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 ?
 
Old 01-27-2004, 05:55 PM   #3
reesee
Member
 
Registered: Jan 2004
Posts: 66

Original Poster
Rep: Reputation: 15
Smile

I understand, and it worked. Thanks alot qwijibow.
 
Old 01-27-2004, 06:35 PM   #4
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
755 is standard?, i mean, i dont think executing a directory is a good thing right?
 
Old 01-27-2004, 06:47 PM   #5
Shade
Senior Member
 
Registered: Mar 2003
Location: Burke, VA
Distribution: RHEL, Slackware, Ubuntu, Fedora
Posts: 1,418
Blog Entries: 1

Rep: Reputation: 46
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
--Shade
 
Old 01-27-2004, 07:13 PM   #6
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
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?
 
Old 01-27-2004, 07:26 PM   #7
reesee
Member
 
Registered: Jan 2004
Posts: 66

Original Poster
Rep: Reputation: 15
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?
 
Old 01-27-2004, 07:39 PM   #8
frob23
Senior Member
 
Registered: Jan 2004
Location: Roughly 29.467N / 81.206W
Distribution: OpenBSD, Debian, FreeBSD
Posts: 1,450

Rep: Reputation: 48
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!
 
Old 01-27-2004, 09:13 PM   #9
Thymox
Senior Member
 
Registered: Apr 2001
Location: Plymouth, England.
Distribution: Mostly Debian based systems
Posts: 4,368

Rep: Reputation: 64
Quote:
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
 
Old 01-28-2004, 06:56 AM   #10
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
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 !!!


Last edited by qwijibow; 01-28-2004 at 07:02 AM.
 
Old 01-28-2004, 07:14 AM   #11
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
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?
 
Old 01-28-2004, 09:26 AM   #12
reesee
Member
 
Registered: Jan 2004
Posts: 66

Original Poster
Rep: Reputation: 15
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.
 
Old 01-28-2004, 02:57 PM   #13
frob23
Senior Member
 
Registered: Jan 2004
Location: Roughly 29.467N / 81.206W
Distribution: OpenBSD, Debian, FreeBSD
Posts: 1,450

Rep: Reputation: 48
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
My God! How to?!? cthinh Linux - Newbie 3 07-04-2005 10:11 PM
Thank god please help! Prometheuz Linux - Newbie 25 06-28-2005 10:56 PM
Oh My God! What Did I Do?!?! goosie Mandriva 6 06-27-2005 06:53 AM
... Oh God. Davus Linux - Software 3 11-30-2004 10:35 PM
I had seen GOD! abimanyu007 Linare 2 09-29-2004 12:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration