1830899 Members
3453 Online
110017 Solutions
New Discussion

Re: Umask parameter !

 
SOLVED
Go to solution
Ivan Azuara
Regular Advisor

Umask parameter !

Where do you define the umask parameter on the system ?.

Is the same to define this parameter into the ".profile" root user, or this parameter must be defined in other place ?.

Thank´s in advance
"Enjoy the life .."
8 REPLIES 8
Alzhy
Honored Contributor
Solution

Re: Umask parameter !

The admin can set it globally in /etc/profile (for Bourne shell and the like) and /etc/csh.login (for Csh and derivatives) so all users by deafault will get the same UMASK. Of course the user can always change it to something else by having it in their home profiles OR invking umask before doing any I/O...
Hakuna Matata.
A. Clay Stephenson
Acclaimed Contributor

Re: Umask parameter !

It can be set globally in /etc/profile; that will establish an initial value. That value, in turn, can be overridden by each user's .profile. Finally, the 'real' value of umask is really the last set value because regardless of settings in .profile the last ulimit command wins.
If it ain't broke, I can fix that.
Michael Schulte zur Sur
Honored Contributor

Re: Umask parameter !

Hi,

you can define umask in a users .profile.
Thats ok!!

greetings,

Michael
Helen French
Honored Contributor

Re: Umask parameter !

If you want tp set for all users, set it in the globacl profile (eg: /etc/profile).

If you want it for a specific user, set it in local profile (eg: $HOME/.profile)

You can also set umask on a session with:

# umask XXXX
Life is a promise, fulfill it!
RAC_1
Honored Contributor

Re: Umask parameter !

umask controls the default permissions on created file.

The best place to set would be /etc/profile, but a knowledgable employee can orverride it with umask command.

a umask of 022 would give rw-r-xr-x permissions for a file. (read/write for owner and read/execute for group and others for files and read/write/execute for owner and read/execute for directory)
There is no substitute to HARDWORK
Jim Butler
Valued Contributor

Re: Umask parameter !

You can change the umask in your environment, so whether you want to set it in the global profile or not, each user has the ability to override, as needed, as long as they have access to their own shell.

(csh = .cshrc)
sh = .login
ksh = .profile
Man The Bilge Pumps!
Todd McDaniel_1
Honored Contributor

Re: Umask parameter !

One important thing to remember that you may already know...

The exe permission can't be set in a umask... attempting to set a umask of 000 with exe permissions will default to a 666 when a file is created.

If you notice the default umask of 022 will set file permissions to 644 not 744.

or as in my case a umask of 066 will default to 600 for my root account.
Unix, the other white meat.
Geoff Wild
Honored Contributor

Re: Umask parameter !

Actually, the best documentation for this is in the Man pages:

man umask


executing just umask by itself will tell you your current settings:

# umask
022
#

As far as execute - if using samba, you can for the mask on file creation from your smb.conf file...

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.