System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

setting variables in profile

madhudeepan
Frequent Advisor

setting variables in profile

i need to set the umask value to 077 permanently for a particular user,, edited the profile in home dir and changed to umask 077 ,,, but its not working,,

do i need to change something else
4 REPLIES
rariasn
Honored Contributor

Re: setting variables in profile

Hi,

Put "umask 002"

rgs
Pete Randall
Outstanding Contributor

Re: setting variables in profile

I'm tempted to just suggest that you read the man page, but first, let's ask what it is you're trying to accomplish with this setting.


Pete

Pete
rariasn
Honored Contributor

Re: setting variables in profile

Sorry,

umask is the inverse of the permission bits that you want to be set. For example:

Permissions
umask (file/directory)
----- -------------------
000 rw-rw-rw-/rwxrwxrwx
002 rw-rw-r--/rwxrwxr-x
022 rw-r--r--/rwxr-xr-x
027 rw-r-----/rwxr-x---
077 rw-r-----/rwx------

Sample user profile:

# @(#)B.11.11_LR

# Default user .profile file (/usr/bin/sh initialization).

# Set up the terminal:
if [ "$TERM" = "" ]
then
eval ` tset -s -Q -m ':?hp' `
else
eval ` tset -s -Q `
fi
stty erase "^H" kill "^U" intr "^C" eof "^D"
stty hupcl ixon ixoff
tabs

# Set up the search paths:
PATH=$PATH:.

# Set up the shell environment:
set -u
trap "echo 'logout'" 0

# Set up the shell variables:
EDITOR=vi
export EDITOR

# Set up shell variables:


PS1="$(hostname):\$PWD\$"
export PS1

umask 077
umask

rgs,
Dennis Handly
Acclaimed Contributor

Re: setting variables in profile

>but it's not working, do I need to change something else

Not working how? You do need to re-login or source your .profile.