1 |
On Saturday 26 May 2007 15:58, Albert Hopkins wrote: |
2 |
> [ Since I gone ahead and polluted the list I'll give my take ] |
3 |
> |
4 |
> On Sun, 2007-06-03 at 14:36 -0400, Dan Cowsill wrote: |
5 |
> > It has been a constant burden to me to have to change the file |
6 |
> |
7 |
> permissions of |
8 |
> |
9 |
> > files I've copied so that other users can access them and modify them. |
10 |
> |
11 |
> Say I |
12 |
> |
13 |
> > have a number of documents in the /root folder which the root user |
14 |
> |
15 |
> owns. Now |
16 |
> |
17 |
> > I want to transfer them to my non-priveliged user so I can work on |
18 |
> |
19 |
> them... |
20 |
> |
21 |
> > But I have to chown them so that is possible. |
22 |
> > |
23 |
> > It just occured to me that there must be an easier way to do things |
24 |
> |
25 |
> like this |
26 |
> |
27 |
> > and I was wondering if you fine fellows could guide me down the right |
28 |
> |
29 |
> path. |
30 |
> |
31 |
> |
32 |
> In my experience it's very rare that root would need to do it. If root |
33 |
> is reserved mostly for doing those dirty sys-admin tasks then it needn't |
34 |
> worry much about file sharing with those pesky users, so far as to say |
35 |
> the usual root-shared files (libraries, executables, /usr/share, etc.) |
36 |
> |
37 |
> Usually it's the case that a) Users need to share a file with root or b) |
38 |
> users need to share files with each other. In the former case it's |
39 |
> trivial. All your file are belong to root. In the latter case, there |
40 |
> are varying methods of doing it, depending on the desired effect. If |
41 |
> it's just a one-time thing usually you'll deposit a file in /tmp |
42 |
> or /var/tmp and share it there. Another way is to consider a group of |
43 |
> users are working a project. Call it project1. |
44 |
> |
45 |
> Create a group called project1: |
46 |
> $ groupadd project1 |
47 |
> |
48 |
> Add users to the group: |
49 |
> $ gpasswd -a user1 project1 |
50 |
> $ gpasswd -a user2 project1 |
51 |
> $ gpasswd -a user3 project1 |
52 |
> |
53 |
> Create a shared directory for the group: |
54 |
> $ mkdir -p /usr/local/projects/project1 |
55 |
> $ chgrp project1 /usr/local/projects/project1 |
56 |
> $ chmod g+s /usr/local/projects/project1 |
57 |
> |
58 |
> Then, depending on your user's umask's they should all have access to |
59 |
> files created in that directory. |
60 |
> |
61 |
> You could also use ACLs but you need make sure your kernel and toolset |
62 |
> is configured for it. |
63 |
> |
64 |
> But I can't remember the last time i needed to share anything in /root |
65 |
> with a non-root user. |
66 |
> -- |
67 |
> Albert W. Hopkins |
68 |
|
69 |
Hey, thanks that makes sense :) |
70 |
|
71 |
Thanks again. |
72 |
-- |
73 |
--- |
74 |
Dan Cowsill |
75 |
http://www.danthehat.net/ |
76 |
GnuPG Public Key: http://www.danthehat.net/wp-content/uploads/public.asc |