Permissions  File permissions and multiple group emulation in unix.

1   Introduction

2   Umask

3   Forcing group

To force the username of a file or directory you set the SUID (s) bit on the directory where the user should be forced. You can not force user on a specific file in a directory (when created). All this are of course only on creation of files, root can change the user later anyway.

4   Forcing user

See forcing group, but set the SGID (s) bit on the directory instead.

5  

In unix there is no flag for hiding a file or directory. What you can do is to rename it with a . in the beginning, like from "foo" to ".foo". The file will still be visible (the user can list it) but not with the normal commands. This type of hiding will be applied on all users, becuase it is as simple as file or directory renaming.

Complete hiding can only be done on the content of a directory. To do that you remove the read (r) permission on the directory but keep the execute (x) permission. This can be done independently on users, groups and others.

6   Multiple groups

Multiple group permissions on a single file or directoty is not possible. It is possible to emulate this though. You do that by creating a new group with the content of the two groups.

g1=u1,u2,u3
g2=u3,u4,u5
mg=u1,u2,u3,u4,u5

To give different permissions to the two groups you have to do more advanced emulation. You can give one group read permissions and an other (or several) group write permission.

Before:

foo
After:
.foo (read)
.foo/foo (readwrite)
foo -> .foo/foo


Copyright © 2008 Ola Lundqvist
Last updated: Tue Jan 01 13:53:24 2008 (CET).
Author: Ola Lundqvist
URL: http://www.opal.dhs.org/docs/file-permissions.oml
Administrator: webmaster@inguza.net