Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here. |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
06-02-2006, 02:03 PM
|
#1
|
LQ Newbie
Registered: Apr 2006
Distribution: Mandriva 2006
Posts: 11
Rep:
|
Directory permissions
Is there is any way to create a special directory, where all the new files created and all the new directoris created under this special directory, wered create with permissions of write and read for all the users?
Thanks
|
|
|
06-02-2006, 03:26 PM
|
#2
|
LQ Guru
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094
|
1) Create a directory and then chown :groupname directory where groupname is a common group that all your users belong to.
2) chmod -R 666 directory -- this sets the directory permissions to read and write for everyone
3) chmod g+s directory -- this sets the "sticky bit", which means all files in this directory will be created with the same group permissions as the directory.
So if you have a directory like
Code:
drw-rw-rw- 2 bob user 1674 Sep 17 1999 user_directory
and set the sticky bit, the directory permissions will look like
Code:
drw-rwsrw- 2 bob user 1674 Sep 17 1999 user_directory
and all files will be created with read write group permissions.
|
|
|
06-06-2006, 11:13 AM
|
#3
|
LQ Newbie
Registered: Apr 2006
Distribution: Mandriva 2006
Posts: 11
Original Poster
Rep:
|
Thanks for your help pljvaldez
I have tried it, but I have some problems if I change permissions of the directory to 666, the other users can't enter to the directory, I have to use 770 permisions to allow all the users of my group to enter to the directory.
And another problem that I have is that using sticky bit, I have created this directory named prova
327253 4 drwxrws--- 2 root marc 4096 jun 6 17:59 prova/
Directory prova has read and write permissions for group but when I create a file named p2, inside the directory
327253 4 drwxrws--- 2 root marc 4096 jun 6 18:07 ./
2 4 drwxr-xr-x 20 root root 4096 jun 6 18:04 ../
327255 4 -rw-r--r-- 1 prova marc 2 jun 6 18:07 p2
Only have write permissions the user, the group not, but It's is a sticky directory, I don't understand why the file is created with out write permissions for the group
|
|
|
06-06-2006, 11:28 AM
|
#4
|
LQ Newbie
Registered: Apr 2006
Distribution: Mandriva 2006
Posts: 11
Original Poster
Rep:
|
Thanks for your help pljvaldez
I have tried it, but I have some problems if I change permissions of the directory to 666, the other users can't enter to the directory, I have to use 770 permisions to allow all the users of my group to enter to the directory.
And another problem that I have is that using sticky bit, I have created this directory named prova
Code:
327253 4 drwxrws--- 2 root marc 4096 jun 6 17:59 prova/
Directory prova has read and write permissions for group but when I create a file named p2, inside the directory
Code:
327253 4 drwxrws--- 2 root marc 4096 jun 6 18:07 ./
2 4 drwxr-xr-x 20 root root 4096 jun 6 18:04 ../
327255 4 -rw-r--r-- 1 prova marc 2 jun 6 18:07 p2
Only have write permissions the user, the group not, but It's is a sticky directory, I don't understand why the file is created with out write permissions for the group
|
|
|
06-06-2006, 04:09 PM
|
#5
|
Senior Member
Registered: Aug 2005
Posts: 1,755
Rep:
|
Quote:
Originally Posted by focus1
I have tried it, but I have some problems if I change permissions of the directory to 666, the other users can't enter to the directory, I have to use 770 permisions to allow all the users of my group to enter to the directory.
|
Yes, DIRECTORIES NEED EXECUTABLE PERMISSION. Executable is the most important permission for directories. It allows people to enter the directory (and access its contents). Read permission allows listing of the directory, but is otherwise unimportant. Write permission allows creating and deletion of contents. That's why "6" is completely useless; directory permissions usually consist of 7, 5, or 1.
Last edited by spooon; 06-06-2006 at 04:11 PM.
|
|
|
All times are GMT -5. The time now is 11:26 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|