Product SiteDocumentation Site

Глава 8. Базовая конфигурация: Сеть, Аккаунты, Печать...

8.1. Настройка другого языка
8.1.1. Установка языка по умолчанию
8.1.2. Configuring the Keyboard
8.1.3. Migrating to UTF-8
8.2. Настройка Сети
8.2.1. Ethernet Interface
8.2.2. Connecting with PPP through a PSTN Modem
8.2.3. Connecting through an ADSL Modem
8.2.4. Automatic Network Configuration for Roaming Users
8.3. Setting the Hostname and Configuring the Name Service
8.3.1. Name Resolution
8.4. User and Group Databases
8.4.1. User List: /etc/passwd
8.4.2. The Hidden and Encrypted Password File: /etc/shadow
8.4.3. Modifying an Existing Account or Password
8.4.4. Disabling an Account
8.4.5. Group List: /etc/group
8.5. Creating Accounts
8.6. Shell Environment
8.7. Printer Configuration
8.8. Configuring the Bootloader
8.8.1. Identifying the Disks
8.8.2. Configuring LILO
8.8.3. GRUB 2 Configuration
8.8.4. For Macintosh Computers (PowerPC): Configuring Yaboot
8.9. Other Configurations: Time Synchronization, Logs, Sharing Access…
8.9.1. Timezone
8.9.2. Time Synchronization
8.9.3. Rotating Log Files
8.9.4. Sharing Administrator Rights
8.9.5. List of Mount Points
8.9.6. locate and updatedb
8.10. Compiling a Kernel
8.10.1. Introduction and Prerequisites
8.10.2. Получение исходного кода
8.10.3. Configuring the Kernel
8.10.4. Compiling and Building the Package
8.10.5. Compiling External Modules
8.10.6. Applying a Kernel Patch
8.11. Installing a Kernel
8.11.1. Features of a Debian Kernel Package
8.11.2. Installing with dpkg
Компьютер с новой инсталляции, созданной с помощью debian-installerв большинстве случаев функционалены, но некоторые службы требуют определённой настройки. Более того, всегда полезно знать как поменять некоторые настройки, которые были сделаны во время установки системы.
Эта глава освещает все что можно назвать "базовой настройкой": сеть, язык и локали, пользователи и группы, печать, точки монтирования и т. п.

8.1. Настройка другого языка

Если при установке системы был использован французский язык, он будет использован как язык системы по умолчанию. Однако полезно знать как можно его поменять при необходимости.

8.1.1. Установка языка по умолчанию

Локаль представляет собой группу региональных настроек. Они включают в себя не только язык текста, но и формат отображения чисел, дат, времени и денежных сумм, а также алфавитные правила сравнения (чтобы правильно учитывать диакритические знаки). Хотя каждый из этих параметров может быть установлен независимо от остальных, мы обычно используем локаль, которая является согласованным набором значений всех параметров, соответствующих «региону» в самом широком смысле. Локали обычно указаны в форме код-языка_КОД-СТРАНЫ, а иногда с суффиксом, для указания набора символов и кодировки, которые будут использоваться. Это позволяет решить идиоматические или типографские различия между различными регионами с одинаковым языком.
The locales package includes all the elements required for proper functioning of “localization” of various applications. During installation, this package will ask to select a set of supported languages. This set can be changed at any time by running dpkg-reconfigure locales as root.
The first question invites you to select “locales” to support. Selecting all English locales (meaning those beginning with “en_”) is a reasonable choice. Do not hesitate to also enable other locales if the machine will host foreign users. The list of locales enabled on the system is stored in the /etc/locale.gen file. It is possible to edit this file by hand, but you should run locale-gen after any modifications. It will generate the necessary files for the added locales to work, and remove any obsolete files.
The second question, entitled “Default locale for the system environment”, requests a default locale. The recommended choice in the U.S.A. is “en_US.UTF-8”. British English speakers will prefer “en_GB.UTF-8”, and Canadians will prefer either “en_CA.UTF-8” or, for French, “fr_CA.UTF-8”. The /etc/default/locale file will then be modified to store this choice. From there, it is picked up by all user sessions since PAM will inject its content in the LANG environment variable.

8.1.2. Configuring the Keyboard

Even if the keyboard layout is managed differently in console and graphical mode, Debian offers a single configuration interface that works for both: it is based on debconf and is implemented in the keyboard-configuration package. Thus the dpkg-reconfigure keyboard-configuration command can be used at any time to reset the keyboard layout.
The questions are relevant to the physical keyboard layout (a standard PC keyboard in the US will be a “Generic 104 key”), then the layout to choose (generally “US”), and then the position of the AltGr key (right Alt). Finally comes the question of the key to use for the “Compose key”, which allows for entering special characters by combining keystrokes. Type successively Compose ' e and produce an e-acute (“é”). All these combinations are described in the /usr/share/X11/locale/en_US.UTF-8/Compose file (or another file, determined according to the current locale indicated by /usr/share/X11/locale/compose.dir).
Note that the keyboard configuration for graphical mode described here only affects the default layout; the GNOME and KDE environments, among others, provide a keyboard control panel in their preferences allowing each user to have their own configuration. Some additional options regarding the behavior of some particular keys are also available in these control panels.

8.1.3. Migrating to UTF-8

The generalization of UTF-8 encoding has been a long awaited solution to numerous difficulties with interoperability, since it facilitates international exchange and removes the arbitrary limits on characters that can be used in a document. The one drawback is that it had to go through a rather difficult transition phase. Since it could not be completely transparent (that is, it could not happen at the same time all over the world), two conversion operations were required: one on file contents, and the other on filenames. Fortunately, the bulk of this migration has been completed and we discuss it largely for reference.
As far as file names are concerned, the migration can be relatively simple. The convmv tool (in the package with the same name) was created specifically for this purpose; it allows renaming files from one encoding to another. The use of this tool is relatively simple, but we recommend doing it in two steps to avoid surprises. The following example illustrates a UTF-8 environment containing directory names encoded in ISO-8859-15, and the use of convmv to rename them.
$ ls travail/
Ic?nes  ?l?ments graphiques  Textes
$ convmv -r -f iso-8859-15 -t utf-8 travail/
Starting a dry run without changes...
mv "travail/�l�ments graphiques"        "travail/Éléments graphiques"
mv "travail/Ic�nes"     "travail/Icônes"
No changes to your files done. Use --notest to finally rename the files.
$ convmv -r --notest -f iso-8859-15 -t utf-8 travail/
mv "travail/�l�ments graphiques"        "travail/Éléments graphiques"
mv "travail/Ic�nes"     "travail/Icônes"
Ready!
$ ls travail/
Éléments graphiques  Icônes  Textes
For the file content, conversion procedures are more complex due to the vast variety of existing file formats. Some file formats include encoding information that facilitates the tasks of the software used to treat them; it is sufficient, then, to open these files and re-save them specifying UTF-8 encoding. In other cases, you have to specify the original encoding (ISO-8859-1 or “Western”, or ISO-8859-15 or “Western (Euro)”, according to the formulations) when opening the file.
For simple text files, you can use recode (in the package of the same name) which allows automatic recoding. This tool has numerous options so you can play with its behavior. We recommend you consult the documentation, the recode(1) man page, or the recode info page (more complete).