07.06.2014 Views

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

GOING FURTHER<br />

GPS modules and other time<br />

sources<br />

If time synchronization is particularly crucial to your network, it is possible to<br />

equip a server with a GPS module (which will use the time from GPS satellites)<br />

or a DCF-77 module (which will sync time with the atomic clock near<br />

Frankfurt, Germany). In this case, the configuration of the NTP server is a<br />

lile more complicated, and prior consultation of the documentation is an<br />

absolute necessity.<br />

8.9.3. Rotating Log Files<br />

Log files can grow, fast, and it is necessary to archive them. The most common scheme is a<br />

rotating archive: the log file is regularly archived, and only the latest X archives are retained.<br />

logrotate, the program responsible for these rotations, follows directives given in the /etc/<br />

logrotate.conf file and all of the files in the /etc/logrotate.d/ directory. The administrator<br />

may modify these files, if they wish to adapt the log rotation policy defined by Debian. The<br />

logrotate(1) man page describes all of the options available in these configuration files. You<br />

may want to increase the number of files retained in log rotation, or move the log files to a<br />

specific directory dedicated to archiving them rather than delete them. You could also send<br />

them by e-mail to archive them elsewhere.<br />

The logrotate program is executed daily by the cron scheduling program (described in Section<br />

9.7, “Scheduling Tasks with cron and atd” (page 204)).<br />

8.9.4. Sharing Administrator Rights<br />

Frequently, several administrators work on the same network. Sharing the the root passwords<br />

is not very elegant, and opens the door for abuse due to the anonymity such sharing creates.<br />

The solution to this problem is the sudo program, which allows certain users to execute certain<br />

commands with special rights. In the most common use case, sudo allows a trusted user to execute<br />

any command as root. To do so, the user simply executes sudo command and authenticates<br />

using their personal password.<br />

When installed, the sudo package doesn't give anyone any rights. To delegate such rights, the<br />

administrator must use the visudo command, which allows them to modify the /etc/sudoers<br />

configuration file (here again, this will invoke the vi editor, or any other editor indicated in the<br />

EDITOR environment variable). Adding a line with username ALL=(ALL) ALL allows the user in<br />

question to execute any command as root.<br />

More sophisticated configurations allow authorization of only specific commands to specific<br />

users. All the details of the various possibilities are given in the sudoers(5) man page.<br />

170 The Debian Administrator's Handbook

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!