[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: default group




charles@lunargraphics.net said:
> Is it possible to force files and directories created by a user to belong
> to a specific group *other* than that user's primary group? and moreover,
> a group that said user is not a member of?

As root...

alpha:~# mkdir /tmp/foo
alpha:~# chgrp nobody /tmp/foo
alpha:~# chmod 3777 /tmp/foo
alpha:~# ls -ld /tmp/foo
drwxrwsrwt   2 root     nobody       1024 Feb  5 22:25 /tmp/foo/

As a regular user...

alpha:~$ id -a
uid=500(steve) gid=500(steve) groups=500(steve)
alpha:~$ touch /tmp/foo/test
alpha:~$ ls -l /tmp/foo/test
-rw-rw-r--   1 steve    nobody          0 Feb  5 22:26 /tmp/foo/test

Note that the file is group writable because...

alpha:~$ umask 
002

Steve
-- 
steve@silug.org           | Linux Users of Central Illinois
(217)698-1694             | Meetings the 4th Tuesday of every month
Steven Pritchard          | http://www.luci.org/ for more info

--
To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.