Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:handbook:systemutils [2022/08/04 10:20] – updated some versions for SliTaz 5 hgt | en:handbook:systemutils [2022/08/13 15:26] (current) – linea | ||
|---|---|---|---|
| Line 94: | Line 94: | ||
| ===== Users, groups and passwords ===== | ===== Users, groups and passwords ===== | ||
| - | To manage users and groups on your SliTaz system | + | To manage users and groups on a SliTaz system, the command line must be used, but file permissions can be changed |
| + | Only the system administrator ('' | ||
| + | a nonprivileged | ||
| + | To add or remove a user named linux: | ||
| < | < | ||
| # adduser linux | # adduser linux | ||
| Line 138: | Line 141: | ||
| < | < | ||
| - | # passwd username </ | + | # passwd |
| === Audio group === | === Audio group === | ||
| - | If you want a new user to be able to listen to music he must be in the audio group. To add an existing user to the audio group: | + | If you want a new user to be able to listen to music he must be in the group '' |
| + | |||
| + | To add an existing user to the group audio: | ||
| + | |||
| + | < | ||
| - | < | ||
| ===== Language and keyboard layout ===== | ===== Language and keyboard layout ===== | ||
| - | SliTaz saves the configuration of the default locale in /// | + | SliTaz saves the configuration of the default locale in '' |
| + | and the keyboard setting is stored in '' | ||
| + | These two files can be edited with your favorite editor or configured respectively with '' | ||
| + | You can modify the settings you choose | ||
| - | < | + | < |
| + | # tazlocale | ||
| Or: | Or: | ||
| - | # tazkeymap </ | + | # tazkeymap |
| - | + | </ | |
| - | To check all available locales or your current configuration, | + | |
| + | To check all available locales or the current configuration, | ||
| < | < | ||
| $ locale -a | $ locale -a | ||
| Line 160: | Line 170: | ||
| </ | </ | ||
| - | ===== Custom | + | ===== Custom |
| + | |||
| + | SliTaz uses the shell provided by busybox linked to '' | ||
| + | To change the default shell for a user, the corresponding field in the user's line in ''/ | ||
| - | SliTaz uses the ash shell linked to sh provided by busybox. Ash is light, fast and standards compliant. To change the default shell for a user you can edit the /etc/passwd file using the corresponding line. After you login, / | + | After login, |
| + | These files can be edited | ||
| === Example: ~/.profile === | === Example: ~/.profile === | ||
| Line 180: | Line 194: | ||
| ===== Bash Shell ===== | ===== Bash Shell ===== | ||
| - | On SliTaz you have the ash and sh shell with a link to Ash, this shell is provided by Busybox. | + | If you wish to use the Bash (Bourne Again SHell), first as system administrator |
| + | Then the system administrator must edit '' | ||
| + | Finally copy '' | ||
| < | < | ||
| # tazpkg get-install bash | # tazpkg get-install bash | ||
| - | # cp / | ||
| - | Note root user: cp / | ||
| # nano / | # nano / | ||
| + | | ||
| </ | </ | ||
| - | The next time you login bash will be your default shell, you can confirm | + | The next time '' |
| + | this can be confirmed | ||
| ===== Editors ===== | ===== Editors ===== | ||
| - | Busybox supplies a clone of vi for normal text editing, but it does have its limitations. | + | Busybox supplies a clone of vi for normal text editing, but it does have its limitations. |
| < | < | ||
| - | Or alternatively if you prefer emacs, SliTaz offers a tiny version: | + | Or alternatively if you prefer emacs: |
| < | < | ||
| ===== Sudo ===== | ===== Sudo ===== | ||
| - | The sudo command can be applied | + | The sudo command can be installed |
| < | < | ||
| - | Note that the configuration file /// | + | Note that the configuration file '' |
| ===== System Time ===== | ===== System Time ===== | ||
| - | To check the current system time, you can simply type: < | + | To check the current system time, you can simply type: |
| + | < | ||
| === TimeZone === | === TimeZone === | ||
| - | On SliTaz, the timezone configuration | + | On SliTaz, the timezone configuration is saved in '' |
| + | This file can be edited | ||
| + | The available timezones | ||
| + | |||
| + | Here's an example using the timezone Europe/ | ||
| < | < | ||
| Line 220: | Line 238: | ||
| === Rdate === | === Rdate === | ||
| - | To synchronize the system clock with a network time server, | + | To synchronize the system clock with a network time server, |
| < | < | ||
| - | To display the time on the remote server, use the //rdate -p// command. | + | To display the time on the remote server, use the '' |
| < | < | ||
| - | === Using ntp === | + | === Using NTP === |
| + | |||
| + | NTP is a protocol to synchronize the time on many different systems via a network. | ||
| + | NTP is a client-server application which uses UDP port 123. | ||
| + | This section describes how to configure a system as an NTP client, deriving its time from the Internet. | ||
| + | There are many servers available on the Internet which provide a NTP service. | ||
| + | <note tip> Experience has shown that NTP servers seldom have a high availability, | ||
| + | This means it may not be such a good idea to configure a particular server as a time source, not even two or three. | ||
| + | After a while none of them might be active any more and time is drifting freely! | ||
| + | A better way is to use the service from ntp.org ( http:// | ||
| + | They provide pools of NTP servers per country or region. | ||
| + | Selecting one of these provides a more reliable connection to a NTP time source. | ||
| + | </ | ||
| - | NTP is a protocol to synchronize the time on many different systems via a network. NTP is a client-server application which uses UDP port 123. This section describes how to configure your system as an ntp client deriving its time from the Internet. There are many servers available on the Internet which provide an ntp service. | ||
| - | <note tip> Experience has shown that ntp servers seldom have a high availability, | ||
| + | Although Slitaz is a small distribution, | ||
| - | Although Slitaz is a small distribution, | + | Most notably: |
| 1: busybox ntpd (included in the base installation). Using busybox ntpd from the command line: | 1: busybox ntpd (included in the base installation). Using busybox ntpd from the command line: | ||
| Line 243: | Line 270: | ||
| 2: ntp.tazpkg (install from packages repository). To install ntp.tazpkg: | 2: ntp.tazpkg (install from packages repository). To install ntp.tazpkg: | ||
| - | < | + | < |
| - | This package includes a decent set of ntp related binaries | + | This package includes a decent set of ntp related binaries |
| < | < | ||
| # tazpkg list-files ntp | # tazpkg list-files ntp | ||
| Line 252: | Line 279: | ||
| / | / | ||
| / | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| / | / | ||
| / | / | ||
| / | / | ||
| - | / | ||
| / | / | ||
| / | / | ||
| / | / | ||
| - | / | ||
| / | / | ||
| / | / | ||
| + | / | ||
| </ | </ | ||
| - | Be aware that Slitaz has several | + | Be aware that Slitaz has several |
| + | We have busybox ntp but also the ntp package. Both provide virtually the same functionality. | ||
| + | If you have limited resources, the busybox version can provide all you need. | ||
| + | If you want all the diagnostic stuff as well, you should rather go for installing ntp.tazpkg. | ||
| === Starting ntpd at boot === | === Starting ntpd at boot === | ||
| - | Probably the easiest way to start busybox ntpd at boot is to add an entry like above to / | + | Probably the easiest way to start busybox ntpd at boot is to add an entry like above to '' |
| + | The explanation below focuses on ntp.tazpkg. | ||
| + | It is unclear which one was intended by the developers to be started by the Server Manager. | ||
| + | This can be somewhat confusing. The verified way to configure the NTP daemon is to use the command line as detailed below. | ||
| - | To start / | + | To start '' |
| 1: Make sure to install the package as shown above ;-). | 1: Make sure to install the package as shown above ;-). | ||
| - | 2: Edit / | + | 2: Edit '' |
| < | < | ||
| Add one line at the end: | Add one line at the end: | ||
| Line 279: | Line 314: | ||
| </ | </ | ||
| - | <note tip> | + | <note tip> |
| + | The NTP daemon | ||
| + | The configuration file **/ | ||
| + | </ | ||
| - | 3: Edit / | + | 3: Edit '' |
| < | < | ||
| On the line with daemons to start, add ntp to the list: | On the line with daemons to start, add ntp to the list: | ||
| - | | + | |
| </ | </ | ||
| - | <note tip> Make sure to enter just ntp, not ntpd! The name is a reference to / | + | <note tip> |
| - | These are the required steps. | + | Make sure to enter just ntp, not ntp**d**! The name is a reference to **/ |
| + | </ | ||
| + | These are the required steps. | ||
| Use the following to check if the daemon is running: | Use the following to check if the daemon is running: | ||
| Line 297: | Line 337: | ||
| In this example, the first line shows the process we want to see. | In this example, the first line shows the process we want to see. | ||
| - | <note tip>Use / | + | <note tip> |
| + | Use **/ | ||
| + | Using ntpd on the command line without the full path causes the busybox version to be invoked! | ||
| + | </ | ||
| === Verifying ntpd operation === | === Verifying ntpd operation === | ||
| - | You may use //ntpq// to verify | + | The '' |
| < | < | ||
| # ntpq -p nl.pool.ntp.org | # ntpq -p nl.pool.ntp.org | ||
| Line 314: | Line 357: | ||
| </ | </ | ||
| - | The * at the start of a line indicates the server | + | The * at the start of a line indicates the server |
| The column " | The column " | ||
| - | Important to check are the columns " | + | |
| + | Important to check are the columns " | ||
| + | The NTP daemon should be running for a while to get reliable output. | ||
| === Hwclock === | === Hwclock === | ||
| - | //Hwclock// allows you to synchronize | + | The '' |
| - | Synchronize | + | Synchronise |
| < | < | ||
| - | Synchronize | + | Synchronise |
| < | < | ||
| < | < | ||
| - | Indicates that the Hardware Clock is kept in Coordinated Universal Time or local time, respectively. It is your choice whether to keep your clock in UTC or local time, but nothing in the clock tells which you've chosen. So this option is how you give that information to hwclock. | + | Indicates that the hardware clock is kept in Coordinated Universal Time or local time, respectively. |
| - | If you specify | + | It is the choice |
| + | So this option is how to give that information to the hardware clock. | ||
| + | If the wrong one of these options | ||
| + | both setting and querying of the hardware clock will be messed up. | ||
| - | < | + | < |
| + | On slitaz, | ||
| + | The result of a non-UTC hardware clock setting is an incorrect time for the timezone. | ||
| + | </ | ||
| - | === Synchronizing | + | === Synchronising |
| - | There are several ways to set the hardware clock to ntp time: | + | There are several ways to set the hardware clock to NTP time: |
| - | < | + | < |
| + | # busybox ntpd -dnqp nl.pool.ntp.org && hwclock -w -u | ||
| + | </ | ||
| OR: | OR: | ||
| - | < | + | < |
| + | # ntpdate -u nl.pool.ntp.org && hwclock -w -u | ||
| + | </ | ||
| Alternative three: (quite old, may not work on all servers) | Alternative three: (quite old, may not work on all servers) | ||
| - | < | + | < |
| + | # rdate -s nl.pool.ntp.org && hwclock -w -u | ||
| + | </ | ||
| - | Note that in all examples | + | Note that in all examples the '' |
| - | Further reading: | + | Further reading: |
| ===== Execute scheduled commands ===== | ===== Execute scheduled commands ===== | ||
| - | The daemon ' | + | The daemon |
| + | This is very useful for routine tasks such as system administration. | ||
| + | The directory | ||
| - | Each user on the system | + | Each user can have his or her own tasks; they are defined in the file '' |
| + | This file can be created | ||
| + | The crontab utility allows (amongst other things), to list the user' | ||
| < | < | ||
| # crontab -l <== To list the crontab for user root. | # crontab -l <== To list the crontab for user root. | ||
| OR: | OR: | ||
| # crontab -l -u tux <== To list the crontab for another user. | # crontab -l -u tux <== To list the crontab for another user. | ||
| + | OR: | ||
| + | tux:~$ crontab -l <== To list the crontab for user tux. | ||
| </ | </ | ||
| Line 366: | Line 429: | ||
| < | < | ||
| - | We will create a file with root privileges | + | We will create a crontab |
| - | < | + | < |
| - | + | ||
| - | Add the line: | + | |
| + | Insert the line: | ||
| < | < | ||
| + | save and exit the editor. | ||
| - | Launch crond with the option //-b// (background), | + | When the system administrator has launched '' |
| < | < | ||
| + | after a few minutes the contents of the file: ''/ | ||
| - | You can wait a few minutes and view the contents of the file: /// | + | < |
| - | < | + | To stop or restart the daemon |
| - | + | ||
| - | To stop or restart the daemon crond: | + | |
| < | < | ||
| Line 392: | Line 453: | ||
| === Invoke the daemon crond on every boot === | === Invoke the daemon crond on every boot === | ||
| - | To launch the daemon ' | + | To launch the daemon |
| + | either before or after the web server or SSH server. | ||
| ===== Add commands to be executed at boot ===== | ===== Add commands to be executed at boot ===== | ||
| - | During the boot process, various scripts are executed to configure services, such as the start of the web server, networking, etc. On SliTaz there is a script | + | During the boot process, various scripts are executed to configure services, such as the start of the web server, networking, etc. |
| + | On SliTaz there is a script | ||
| + | Also new scripts | ||
| < | < | ||