Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:handbook:systemutils [2013/06/15 21:17] – Nice job emgi linea | en:handbook:systemutils [2022/08/13 15:26] (current) – linea | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| ===== Devices and disk access ===== | ===== Devices and disk access ===== | ||
| - | With Linux your disks and USB media are seen as devices. To access them you must first mount a device on a mount point (directory). On SliTaz | + | With Linux disks and USB media are seen as devices. To access |
| + | |||
| + | On SliTaz devices | ||
| + | |||
| + | To mount the first partition | ||
| < | < | ||
| # mkdir -p /mnt/disk | # mkdir -p /mnt/disk | ||
| - | # mount /dev/hda1 /mnt/disk | + | # mount /dev/sda1 /mnt/disk |
| </ | </ | ||
| - | To mount a cdrom or an USB media you should use mount points located in ///media//. Note that for a cdrom, you just have to specify the device path. For a flash key, the mount point already exists: | + | To mount an optical disk or an USB medium, |
| + | |||
| + | Note that for an optical disk, you just have to specify the device path. For a flash key, the mount point already exists: | ||
| < | < | ||
| Line 17: | Line 23: | ||
| </ | </ | ||
| - | === ntfs filesystem === | + | === NTFS filesystem === |
| - | If you need read/write access to Windows ntfs filesystems | + | If read or write access to Windows ntfs filesystems |
| + | |||
| + | The '' | ||
| + | Note that ntfs partitions | ||
| + | |||
| + | === NFS === | ||
| + | |||
| + | NFS (Network File System) is the native UNIX and Linux method for sharing file systems. | ||
| + | In this respect its function is similar to Samba. | ||
| + | |||
| + | The most popular version is still NFSv3, which is able to use UDP or TCP as the network protocol. | ||
| + | |||
| + | The older NFSv2 was only capable of using UDP. | ||
| + | |||
| + | On a LAN, UDP is still the fastest protocol; TCP is to be preferred when the machines are connected over a WAN. | ||
| + | |||
| + | NFSv3 has been superseded by NFS version4 which has notable improvements (security) over v3 but its configuration has become a lot more complex as a result. | ||
| + | |||
| + | An NFS server exports a part of it's file system; i.e. makes it available on the network. | ||
| + | The server is configured with details about client ip addresses or host names and can restrict their access to the file system. | ||
| + | Access can be read-only, read-write or no access at all. | ||
| + | An NFS client simply mounts the exported file systems as if they were local devices. | ||
| + | |||
| + | The NFS software in Slitaz makes it possible to run both as a server or a client. | ||
| + | To start the NFS processes, you need to run the init script in ''/ | ||
| + | < | ||
| + | <note tip>The NFS daemons must be running also when the machine acts as a client.</ | ||
| + | |||
| + | == NFS Software Installation == | ||
| + | To start using NFS, the following packages are required: | ||
| + | < | ||
| + | # tazpkg -l | grep nfs | ||
| + | linux-nfsd | ||
| + | nfs-utils | ||
| + | </ | ||
| + | |||
| + | Install them using: | ||
| + | < | ||
| + | # tazpkg -gi linux-nfsd | ||
| + | # tazpkg -gi nfs-utils | ||
| + | </ | ||
| + | |||
| + | == / | ||
| + | Here is a sample exports file: | ||
| + | < | ||
| + | # / | ||
| + | # to NFS clients. | ||
| + | # | ||
| + | # Example for NFSv2 and NFSv3: | ||
| + | # / | ||
| + | # | ||
| + | # Example for NFSv4: | ||
| + | # / | ||
| + | # / | ||
| + | # | ||
| + | /usb1 | ||
| + | </ | ||
| + | The server is only exporting one filesystem: usb1. Clients must be in the 192.168.1.0/ | ||
| + | |||
| + | To use nfs on the client; all you need to do is start nfsd and mount the share: | ||
| + | < | ||
| + | # / | ||
| + | # mkdir / | ||
| + | # mount server:/ | ||
| + | </ | ||
| + | Please note the specific format for nfs shares ''// | ||
| ===== 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 31: | Line 105: | ||
| - | === Manipulating users & group membership: === | + | === Manipulating users and group membership === |
| - | Linux groups are a mechanism to manage a collection of computer system users. All Linux users have a user ID and a group ID and a unique numerical identification number called a userid (UID) and a groupid (GID) respectively. Groups can be assigned to logically tie users together for a common security, privilege and access purpose. It is the foundation of Linux security and access. Access to files and devices may be granted based on a user ID or a group ID. This mechanism is the same for all of linux but the way it is configured varies per distribution. Sometimes additional or different commands are used, like for example usermod, chgrp, useradd or groupadd. Below is an overview of how to handle users, groups and group membership on Slitaz. | + | Linux groups are a mechanism to manage a collection of computer system users. |
| + | All Linux users have a user name and a group name and a unique numerical identification number called a userid (UID) and a groupid (GID) respectively. | ||
| + | Groups can be assigned to logically tie users together for a common security, privilege and access purpose. | ||
| + | It is the foundation of Linux security and access. | ||
| + | Access to files and devices may be granted based on a userid | ||
| + | This mechanism is the same for all of linux but the way it is configured varies per distribution. | ||
| + | Sometimes additional or different commands are used, like for example | ||
| + | Below is an overview of how to handle users, groups and group membership on Slitaz. | ||
| - | The Slitaz way is using only four commands. Simple | + | The Slitaz way is using only four commands. Simple |
| < | < | ||
| Line 53: | Line 134: | ||
| </ | </ | ||
| - | Any user can be member of any group and the combination of user & group permissions allows for granular access to system resources. | + | Any user can be member of any group and the combination of user and group permissions allows for granular access to system resources. |
| === Passwd === | === Passwd === | ||
| Line 60: | 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 82: | Line 170: | ||
| </ | </ | ||
| - | ===== Custom | + | ===== Custom |
| - | SliTaz uses the ash shell linked to sh provided by busybox. | + | SliTaz uses the shell provided by busybox |
| + | To change the default shell for a user, the corresponding field in the user's line in '' | ||
| + | |||
| + | After login, | ||
| + | These files can be edited | ||
| === Example: ~/.profile === | === Example: ~/.profile === | ||
| Line 102: | 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 142: | 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 | + | NTP is a protocol to synchronize the time on many different systems via a network. |
| - | <note tip> Experience has shown that ntp servers seldom have a high availability, | + | NTP is a client-server application which uses UDP port 123. |
| + | This section describes how to configure | ||
| + | There are many servers available on the Internet which provide | ||
| + | <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. | ||
| + | </ | ||
| - | 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 165: | 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 174: | 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 201: | 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 219: | 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 236: | 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 288: | 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 314: | 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 | ||
| < | < | ||