Solved How do I set the file creation attributes for a user to u=rwx, g=rwx, o=r?

I have a small number of users (4) using a multi-user application. To avoid permissions issues I want to set the file creation attributes for the users of the application to owner = read, write, execute; group = read, write, execute; others = read.

I think I do this with
Code:
umask=002
but I'm not sure how to implement this. Does it go in .profile? Advice please. Thanks.
 
Thank you for your reply getopt. I'm a bit confused now, I thought the syntax for csh was very different to sh, and login.conf was a system wide configuration file. I'd rather leave the system wide defaults as standard and alter the individual configurations.
 
I have a small number of users (4) using a multi-user application. To avoid permissions issues I want to set the file creation attributes for the users of the application to owner = read, write, execute; group = read, write, execute; others = read.

I think I do this with
Code:
umask=002
but I'm not sure how to implement this. Does it go in .profile? Advice please. Thanks.
Even with that umask, those files won't have exec permission. POSIX specifies a default mode of 666 for files and 777 for directories. The value of the umask will be subtracted by the defaults, and you will get your desired permissions.

In your specicfic case you will get:
Code:
666 -
002 =

664 (rw-rw-r--)
So, either your users or the application they use must set the exec permission (like compilers do, for example).
 
Thank you for your reply getopt. I'm a bit confused now, I thought the syntax for csh was very different to sh, and login.conf was a system wide configuration file. I'd rather leave the system wide defaults as standard and alter the individual configurations.
Every user can have their own ~/.login_conf (the DESCRIPTION section of login.conf(5) is not that long and worth reading). Just add this if it's currently empty:
Code:
me:umask=002:
and don't forget to cap_mkdb ~/.login_conf afterwards.
 
Being lazy and hopeless I've gone the system wide default route:
First I changed the umask to 002 in /etc/login.conf then recompiled the database:
# cap_mkdb /etc/login.conf
Solved.
 
Back
Top