How to set the file creation UMASK

The umask setting controls the default permissions for files created by users.

I like to set the umask so that by default files are only readable by their owner.

Set the umask in /etc/profile:

# umask 022
umask 077

Set the umask in /etc/login.defs:

# 022 is the "historical" value in Debian for UMASK when it was used
# 027, or even 077, could be considered better for privacy
# There is no One True Answer here : each sysadmin must make up his/her
# mind.
#UMASK          022
UMASK           077

Set the umask in /root/.bashrc:

# umask 022
umask 077

Discussion

Enter your comment (wiki syntax is allowed):

Subscribe to the RSS feed for Andy's Debian HOWTOs

Article from Andy's Debian HOWTOs (http://www.besy.co.uk/debian/debian)

 
debian/how_to_set_user_s_umask.txt · Last modified: 2008/08/02 00:11 (external edit) · [Old revisions]
Recent changes RSS feed Powered by Debian Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki