HOW DO YOU CHANGE THE DEFAULT PERMISSIONS THAT GET SET WHEN A FILE IS CREATED?

ITEM: RTA000029735



                                                                                
                                                                                
                                                                                
QUESTION:                                                                       
How do you change the default permissions that get set when a file              
is created?                                                                     
                                                                                
---------- ---------- ---------- --------- ---------- ----------                
A:   To change the default permission that gets set when a file is              
created you can use the 'umask' command.  The umask is the octal                
complement of what you would like your permissions to be, not the               
actual value of the permissions to be used.  So in the case of a                
'umask 022', the expected permissions of a new text file are 644,               
or -rw-r--r-- as view with the ls -l command.                                  
                                                                                
    If you are not of an octal mindset, all the commands that affect            
the file permission bits accept a symbolic notation to set and clear            
file permissions.  For example, you can change the file masking to              
read and write permissions for everyone using the following command:            
                                                                                
umask ugo+rw                                                                    
                                                                                
Now, the expected permissions of the new text file is -rw-rw-rw-.               
NOTE:  You can not set the execution bit with the usmask command.               
       For example, the command 'umask ugo+rwx' would produce the               
       same results as 'umask ugo+rw'.   The executable bit is either           
       set by the application creating the executable (such as a                
       compiler) or by the user with the chmod command (as in the              
       case of making a executable script).                                     
                                                                                
    You can change the default umask stanza in the /etc/security/user.          
This stanza has the default umask value of 022.  This is where smit             
gets 022, which happens to displayed as 22.   It drops the leading              
zero because the conversion of the number to octal is handled at a              
lower lever.  If you change the default, smit will create all new               
users with this umask.                                                          
                                                                                
    Also, you can put the 'umask' command in a user's .profile.                 
                                                                                
---------- ---------- ---------- --------- ---------- ----------                
                                                                                
                                                                               
This item was created from library item Q621901 1994 CCBNX                      
                                                                                
S e a r c h - k e y w o r d s:                                                  
CCBNX CHANGE CREATED DEFAULT FILE FILES GET IX MAR93 OP PERMISSIONS             
RISCOSO RISCSYSTEM SET SETTING SOFTWARE SYS                                     
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                               


WWQA: ITEM: RTA000029735 ITEM: RTA000029735
Dated: 07/1998 Category: RISCOCMD
This HTML file was generated 99/06/24~12:43:11
Comments or suggestions? Contact us