dpkg-reconfigure tzdata
command, which allows you to choose the timezone to be used in an interactive manner (until lenny, the command to use was tzconfig
). Its configuration is stored in the /etc/timezone
file. Additionally, the corresponding file in the /usr/share/zoneinfo
directory is copied in /etc/localtime
; this file contains the rules governing the dates where daylight saving time is active, for countries that use it.
TZ
environment variable, which takes priority over the configured system default:
$
date
Wed Mar 28 15:51:19 CEST 2012
$
TZ="Pacific/Honolulu" date
Wed Mar 28 03:51:21 HST 2012
/etc/default/ntpdate
file.
/etc/ntp.conf
file, the most significant alteration being the NTP server to which it refers. If the network has a lot of servers, it may be interesting to have one local time server which synchronizes with the public servers and is used as a time source by the other servers of the network.
X
archives are retained. logrotate
, the program responsible for these rotations, follows directives given in the /etc/logrotate.conf
file and all of the files in the /etc/logrotate.d/
directory. The administrator may modify these files, if they wish to adapt the log rotation policy defined by Debian. The logrotate(1) man page describes all of the options available in these configuration files. You may want to increase the number of files retained in log rotation, or move the log files to a specific directory dedicated to archiving them rather than delete them. You could also send them by e-mail to archive them elsewhere.
logrotate
program is executed daily by the cron
scheduling program (described in Section 9.7, “Scheduling Tasks with cron
and atd
”).
sudo
program, which allows certain users to execute certain commands with special rights. In the most common use case, sudo
allows a trusted user to execute any command as root. To do so, the user simply executes sudo command
and authenticates using their personal password.
visudo
command, which allows them to modify the /etc/sudoers
configuration file (here again, this will invoke the vi
editor, or any other editor indicated in the EDITOR
environment variable). Adding a line with username
ALL=(ALL) ALL
allows the user in question to execute any command as root.
/etc/fstab
file gives a list of all possible mounts that happen either automatically on boot or manually for removable storage devices. Each mount point is described by a line with several space-separated fields:
blkid device
) prefixed with UUID=
. This guards against a change in the name of the device in the event of addition or removal of disks, or if disks are detected in a different order.
ext3
, vfat
, ntfs
, reiserfs
, xfs
are a few examples.
swap
special value is for swap partitions; the auto
special value tells the mount
program to automatically detect the filesystem (which is especially useful for disk readers and USB keys, since each one might have a different filesystem);
mount
man page. The most common are
rw
or ro
, meaning, respectively, that the device will be mounted with read/write or read-only permissions.
noauto
deactivates automatic mounting on boot.
user
authorizes all users to mount this filesystem (an operation which would otherwise be restricted to the root user).
defaults
means the group of default options: rw
, suid
, dev
, exec
, auto
, nouser
and async
, each of which can be individually disabled after defaults
by adding nosuid
, nodev
and so on to block suid
, dev
and so on. Adding the user
option reactivates it, since defaults
includes nouser
.
0
. When it is 1
, it tells the dump
tool that the partition contains data that is to be backed up.
0
, no check is conducted. The root filesystem should have the value 1
, while other permanent filesystems get the value 2
.
Example 8.6. Example /etc/fstab
file:
# /etc/fstab: static file system information. # # <file system> <mount point> <type> <options> <dump> <pass> proc /proc proc defaults 0 0 # / was on /dev/sda1 during installation UUID=c964222e-6af1-4985-be04-19d7c764d0a7 / ext3 errors=remount-ro 0 1 # swap was on /dev/sda5 during installation UUID=ee880013-0f63-4251-b5c6-b771f53bd90e none swap sw 0 0 /dev/scd0 /media/cdrom0 udf,iso9660 user,noauto 0 0 /dev/fd0 /media/floppy auto rw,user,noauto 0 0 arrakis:/shared /shared nfs defaults 0 0
/shared/
directory on the arrakis server is mounted at /shared/
on the local machine. The format of the /etc/fstab
file is documented on the fstab(5) man page.
locate
command can find the location of a file when you only know part of the name. It sends a result almost instantaneously, since it consults a database that stores the location of all the files on the system; this database is updated daily by the updatedb
command (executed by the /etc/cron.daily/find
script).
locate
, it is important to ensure hidden files are not revealed to the user. This is why the updatedb
command runs with the limited permission of the nobody user, which is a classic pattern on Unix systems for this kind of task. Furthermore, the administrator can configure some directories to be skipped by simply listing them in the PRUNEDPATHS
variable in /etc/updatedb.conf
.
locate
command with a more secure version that only returns the names of files accessible to the user who employs it.