The umask setting is typically set on a per-shell basis. To change the umask for everyone put it in /etc/profile. For an individual user put in ~/.bash_profile.
If you want default directory permissons to be 755 then the umask needs to be 022. The umask is the permission you want subtracted from 777. In this example 777 - 755 = 022.
The umask only applies to newly created files; if you need to change the permissions on an existing file use the 'chmod' command.
There is no automated method of making the umask different for different directories. It's the same value everywhere, but you could set up a cron script to change the permissions on some or all the files in a given directory within a minute of when they are created.
Last edited by dsegel; 09-28-2004 at 11:42 AM.
|