| Permissions | File permissions and multiple group emulation in unix. |
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.
See forcing group, but set the SGID (s) bit on the directory instead.
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.
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,u5To 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.
- First you do the above group merging.
- Create a new directory (.foo?) and give that the permissions for reading.
- Move the file or directory to that directory and give that one write permissions, with proper SUID, SGID.
- Create a symlink from the old file or directory name to the new name in the .foo directory.
Before:
fooAfter:.foo (read) .foo/foo (readwrite) foo -> .foo/foo
Copyright © 2008 Ola Lundqvist |