ACPI administration advocacy advocacy advocacy opinion alsa amarok apache apple apt aptitude audio audo authentication automount avi awk bash BIOS boot business cache calendar calibre cdr cdrecord censorship commandline computerscience console convert cron cut database date debian degree design desktop development disk dpkg dvd economics education emacs email europe exim faad ffmpeg file files firefox firewall flash foss freedom ftp fun fuse git gnumeric graphics grep growisofs grub gtkpod hardware hardware html idiocy image imagemagick images installation ip iphone ipod iptables iso itunes ivman kde kernel keyboard knoppix lame laptop latex linux locale lockin longlines m4a microsoft mimetypes minitab mount mp3 mp4 mplayer multimedia music mysql network nfs nfs4 nmap openbox openoffice opinion opinion partition pdf perl php politics postgresql printing privacy programming rant remote rhythmbox rss rsync rxvt scp screengrab screenshot script scripting scsi security sed server shell siteadmin sitenews sitesoftware skype skype slackware sound sox spam spreadsheet ssh statistics subversion sudo svk swap t23 t43 terminal text thinkpad thunderbird time timezone ubuntu udev upgrade usb usbmount users uuid versioncontrol vfat video vnc windows wine wordpress wordprocessing X40 xwindows xwindows youtube
To set file default permissions on your system, umask is the tool. To understand how it works though, you need to understand [Octal File Permissions]. Read that? Good.
On most systems umask is set in /etc/profile, although it can also be set by each user. When files are created the argument of umask is used to turn off bits on 0666, which creates the file permissions.
So for example, one common umask in /etc/profile is:
umask 022
This is how it works. Octal 022 is 000 010 010 in binary. The default option for creating files is octal 666 or 110 110 110 in binary. Turning off those bits as set by umask leaves us with binary 110 100 100, which is octal 644 and corresponds to rw-r--r-- file permissions, the owner can read and write whereas group and others can only read.
A more restrictive umask may be 026, or binary 000 010 110, when 'masked' with 0666 we get 0640 which corresponds to file permissions rw-r-----. So, while group members may read the file, the rest of the world may not.
Be careful though, if you make a mistake with the umask value you can get some funny results. A umask of 024, gives you file permissions rw-r---w-. This means that although the author can read and write the file and the group members can read it. The rest of the world can write to it if they want. That's not normally what you