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.
|
 |
01-18-2006, 09:16 PM
|
#1
|
LQ Newbie
Registered: Jan 2006
Posts: 16
Rep:
|
permissions - is this the best approach?
I've set up a Linux and Mac Appletalk (netatalk) LAN. On the Linux box (Debian Etch) I have a shared directory for passing files to/from the Linux box, that is accessed from the Mac (while AppleTalk allows a peer-to-peer network model, netatalk only provides for a Mac to "see" a Linux system but the Linux system can't "see" a Mac for file sharing).
As root on the Linux box I created a new user "lanshare" accepting standard permissions for the /home/lanshare directory
owner: rwx group: r-x others: r-x
I also added to the "lanshare" group the other Linux users that I want to be able to use a shared directory.
Then I logged in as "lanshare" and created the folder "public" in /home/lanshare/. For this "public" folder I modified the permissions to
owner: rwx group: rwx others: ---
and I set the sticky bit.
The idea is to allow various users on the Linux box the ability to create and delete their own files in /home/lanshare/public and to read/copy any files therein. The Mac will create and delete files therein as the user "lanshare."
This seems to work as intended, but I'm wondering if such is the best way to handle the setup?
Thank you,
Lee C
|
|
|
01-19-2006, 04:05 PM
|
#2
|
Senior Member
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549
Rep:
|
Quote:
This seems to work as intended, but I'm wondering if such is the best way to handle the setup?
|
Yes but I'd also set the setguid bit on that public directory, and any subdirectories. This means that when one of your users creates a new file or folder it will be owned by the group lanshare, even if that's not their primary group.
|
|
|
01-19-2006, 04:47 PM
|
#3
|
LQ Newbie
Registered: Jan 2006
Posts: 16
Original Poster
Rep:
|
Thanks for the reply tkedwards,
I also found the following on the Debian list, but I don't understand the solution if it is a problem.
----------------
IIRC, things may become messy, when users start to *copy* files to /home/lanshare/public. Then the sticky bit is not preserved; it works only for files *created* in that directory. It should be noted somewhere in the info pages.
The solution in our case was to export the mount with restrictions, ie.
/etc/exports on the computer with the 'public' fs has a line:
/home/lanshare/public 192.168.0.0/255.255.255.0(anonuid=503,anongid=100,all_squash,rw,sync)
just replace your network and the uid of user lanshare.
--------------------------
|
|
|
01-19-2006, 05:38 PM
|
#4
|
Senior Member
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549
Rep:
|
Quote:
IIRC, things may become messy, when users start to *copy* files to /home/lanshare/public. Then the sticky bit is not preserved; it works only for files *created* in that directory. It should be noted somewhere in the info pages.
|
Took me a minute (and a bit of experimentation with test files) to work out what he's saying. What he means is that even with the setgid bit set on the directory (note: not the sticky bit - its a different thing and it doesn't apply to files anyway) if you copy a file from another directory into the public directory it will not automatically get the group ownsership of 'lanshare'.
So for eg. if you do touch /home/lanshare/public/testfile1 you will see that testfile1 has group ownsership of lanshare, which is what you want. Now do touch /any/other/directory/testfile2 and cp /any/other/directory/testfile2 /home/lanshare/public/. You'll see that testfile2 still has group ownership of whatever your primary group is for your username - ie. the setgid bit has had no effect on it because it wasn't created in that /home/lanshare/public directory.
|
|
|
All times are GMT -5. The time now is 01:09 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
|
|