Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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!
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.
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
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?
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?
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!
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
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 !!!
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?
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.