Gentoo Archives: gentoo-user

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

Replies

Subject Author
Re: [gentoo-user] File permissions and such Dan Cowsill <danthehat@×××××.com>