[opensuse] setting file permissions/umask
Where's the right place to do this in 10.2: 1-globally a-/etc/profile? b-/etc/profile.local? c-/etc/bashrc? d-elsewhere? 2-per user d-~/.bashrc? e-~/.bash_profile? f-~/.profile? g-elsewhere? How do I find out the current umask setting without creating a new file and examining its permissions? It doesn't seem to exist in the output of the set command. I want all regular files in a particular public directory to be rw-rw-r--. How do I set that up? I want all regular files in a particular public directory to have one particular owner and group. How do I set that up? TIA -- "Let your conversation be always full of grace." Colossians 4:6 NIV Team OS/2 ** Reg. Linux User #211409 Felix Miata *** http://mrmazda.no-ip.com/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 2006-12-19 00:08, Felix Miata wrote:
Where's the right place to do this in 10.2: 1-globally a-/etc/profile? b-/etc/profile.local? c-/etc/bashrc? d-elsewhere?
/etc/profile.local
2-per user d-~/.bashrc? e-~/.bash_profile? f-~/.profile? g-elsewhere?
~/.profile
How do I find out the current umask setting without creating a new file and examining its permissions? It doesn't seem to exist in the output of the set command.
umask For the next two, if you want it done recursively in all subdirectories, add --recursive or -R to the commandlines.
I want all regular files in a particular public directory to be rw-rw-r--. How do I set that up?
chmod 0664 <dirname>/*
I want all regular files in a particular public directory to have one particular owner and group. How do I set that up? chown username:groupname <dirname>/*
-- The best way to accelerate a computer running Windows is at 9.81 m/s² -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Tuesday 19 December 2006 08:21, Darryl Gregorash wrote:
I want all regular files in a particular public directory to be rw-rw-r--. How do I set that up?
chmod 0664 <dirname>/*
As an alternative: chmod a=r,ug+w <dirname>/* Letters might be easier to remember. ;-) "man chmod" has the details. Cheers, Leen -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 2006/12/19 01:21 (GMT-0600) Darryl Gregorash apparently typed:
How do I find out the current umask setting without creating a new file and examining its permissions? It doesn't seem to exist in the output of the set command.
umask
Too logical. :-p
For the next two, if you want it done recursively in all subdirectories, add --recursive or -R to the commandlines.
I want all regular files in a particular public directory to be rw-rw-r--. How do I set that up?
chmod 0664 <dirname>/*
I know how to do that. What I meant was a way to prevent any files from ever existing there with any status other than rw-rw-r--. IOW, when some user with a umask of 022 copies his rw-r--r-- file from somewhere else to this directory, the copy should automatically and instantly acquire rw-rw-r-- by virtue of its placement there.
I want all regular files in a particular public directory to have one particular owner and group. How do I set that up?
chown username:groupname <dirname>/*
Same as previous, automatically always one and only one owner and group for every file placed in the particular location. These functions are apparently possible for nfs shares via the export options all_squash,anonuid=###,anongid=###, so they ought to be possible for all local users as well. -- "Let your conversation be always full of grace." Colossians 4:6 NIV Team OS/2 ** Reg. Linux User #211409 Felix Miata *** http://mrmazda.no-ip.com/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Felix Miata wrote:
These functions are apparently possible for nfs shares via the export options all_squash,anonuid=###,anongid=###, so they ought to be possible for all local users as well.
You might be able to export the directories to the local machine. i.e. make the local filesystem inaccessible directly by local users but make it visible via NFS at your standard nfs mount point. Haven't tried it, just a WAG. Cheers, Dave -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Felix Miata wrote: I can't answer your SUSE-profile setup question, as I don't use SUSE's profile organization. Generally, one sets umask in profile and not in bashrc.
How do I find out the current umask setting without creating a new file and examining its permissions? It doesn't seem to exist in the output of the set command.
umask without parameters outputs the current umask.
I want all regular files in a particular public directory to be rw-rw-r--. How do I set that up?
With default ACLs on the parent directory. It is not possible to set umask for a specific directory. Btw, umask is ignored when the parent directory has a default ACL. There are some a nasty fine points, though: This works only for *new* files. If one moves an existing file in that directory, that doesn't change its access rights. Furthermore, if the creat() or open() system call that is effectively used specifies mode bits that are more restrictive (e.g., rw-r--r--), the intersection of the default ACL and these mode bits is used.
I want all regular files in a particular public directory to have one particular owner and group. How do I set that up?
In classic Unix, owner inheritance is not possible if one wants to use the standard POSIX commands. I don't know any way to do it with ACLs either. Group inheritance can be done by setting the group-setid bit of the parent directory. This does not work for files that are moved into the directory, only for newly created files. The normal way to solve your actual problem: Write a bunch of commands: to copy files to that directory, rename them, and remove them. Make them setuid to the particular user. Within the commands use chmod to control the final access bits of the new files. If you want to use Perl for these commands, you need either to create setuid wrapper-scripts, or you need to enable setuid Perl-scripts by chmod u+s /usr/bin/sperl*. HTH, Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod Email: jschrod@acm.org Roedermark, Germany -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (5)
-
Darryl Gregorash
-
Dave Howorth
-
Felix Miata
-
Joachim Schrod
-
Leendert Meyer