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
Getting file permissions right is essential for administering Linux systems. This is normally done with the [chmod] command. So, for example,
chmod +w
will make a file writable. Power users, though, usually prefer to use [chmod] with octal values. Octal values are numbers based on base 8. They work well with computers because they correspond exactly to three bit binary numbers so, octal 02 (octal numbers are usually written with a leading '0') corresponds to binary 010, and octal 07 corresponds to binary 111.
File permissions on Linux and Unix are usually made up of three values. 'r' allows a user to read the file, 'w' to write it, and 'x' indicates whether they may execute it. Octal numbers can match up exactly, the first bit indicating whether a file is readable, the second whether it is writable and the third whether it is executable.
There are three sets of permissions for files, the first for the author the second for the group and the third for others. So, a typical file permission might be rw-r--r--. This allows the author to read and write a file and group members and others only to read it. This set of permissions corresponds to binary 110100100 and therefore to octal 0644. To set the above file permissions using [chmod], you'd write:
chmod 0644 filename
where 'filename' is the name of the file your working on.
A more restrictive file permission might be binary 110000000 or octal 0600 this allows only the author to read and write the file.
Another example is:
chmod 0750 filename
This allows the file named 'filename' to be read, written and executed by the author, written and executed by members of the group and not accessed at all by anyone