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

Re: [K12OSN] file permissions for different groups?



On Sun, 2006-06-11 at 14:37, Krsnendu Dasa wrote:
> I am not sure if I understand.
> 0022 makes read/write access for owner and read only access for the
> group.. right?
> 0002 adds write access for the group..right?

Yes, adding bits to umask removes the corresponding bit from
permissions when a file is created when you look at the
value in binary.

> So the logic of having my own group is so noone has access to my files
> until I specifically change groups or add someone to my group. But
> then they still only have readonly access why not read/write access? 

The old unix 0022 was based on the idea that groups would
work together and share things but if someone wanted to
modify a file they would make their own copy in their own
home directory instead of surprising you with changes to
your copy.  Current use tends to control access more
closely.  Here is the conceptual reference from
RedHat:
http://www.redhat.com/docs/manuals/linux/RHL-7.3-Manual/ref-guide/s1-users-groups-private-groups.html

> I basically want my staff to be able to upload files which can
> automatically be read and written to by the group specified by the
> setgid of the directory.
> If users want to change the permissions they can do so manually. But
> by default it should be read/write accessible by group members. 

That's a umask of 002.

> To do this should I edit /etc/bashrc?

That does it for everyone who logs in with a bash shell.  Since you
said 'upload' that might or might not involve a shell login.  Samba
has it's own settings for file/directory creation modes, vsftpd has
its own settings and can use a different default for local
and anonymous users.  Rsync-over-ssh or scp should pick up
the shell settings but have options to duplicate the modes
of the source file.  There are also an assortment of web based
applications for sharing files that have their own ideas about
how to control things.

> If I change /etc/bachrc will that change to umask for all users? If so
> what is the value of umask on the command line? It seems to reset when
> you log out?

/etc/profile and /etc/bashrc set initial defaults for a login
shell.  These can be modified by settings in individual
$HOME/.bash_profile and $HOME/.bashrc files and again by
manual changes in the same manner as environment variable
settings.  The sequence starts over when you log in again.

-- 
  Les Mikesell
   les futuresource com



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