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!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
the three digits are permissions for each of the three classes:
1. user - owner of the file
2. group - people other than owner who are in the group of the file
3. other - people in neither of the above
for files (pretty self explanatory):
read - read the file
write - write to file
execute - allows you to execute it as a command
read - allows you to list the directory (get the names of the contents)
write - allows you to create/delete/move things in the directory
execute (most important) - allows you to access the contents of the directory
First number is for the owner of the file, the second is for the group and the last is for all.
Execute is straightforward : the file is executable (scripts, binary programs).
Write is for modifying the file.
Read is to view its content.
To hide a file, put it is a directory without execute permission.
If you name a file with a . prefix, the file is hidden but it's easy to see it with good glasses.
can I put different permission to different groups on the same file?
Lets say I have groups : A,B,C,D,E,F,G
and I want group A to have permission 1 (only execute)
group B - 2 (only write)
C - 3 (write + execute)
D - 4 (Read Only)
E - 5 (Read and execute)
F - 6 (Read and Write)
G - 7 (Read, Write and Execute).
Yes, it is, at least with ACLs (Access Control Lists). Try looking at the getacl and setacl commands.
In most cases, but maybe not in the example you've given (since this is indeed quite a complex example),
a combination of file ownership, group and file permissions can usually do the trick.
So, in practice, I'd try to stay away from ACLs if you can.
For instance, you could:
-make larger groups, that combine all members of the groups that have same permissions
-use special bits like the setUID and setGID bit to force the owner/group when executing the file.
-play around with the permissions on the parent directory (or any of the parent directories in the full path of the file).