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/13 15:50] – [System Time] emgi | 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 30: | Line 104: | ||
| </ | </ | ||
| - | To add or remove | + | |
| + | === Manipulating users and group membership === | ||
| + | |||
| + | 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 and Elegant. ;-) | ||
| + | |||
| + | < | ||
| + | # adduser < | ||
| + | |||
| + | # deluser < | ||
| + | |||
| + | # addgroup | ||
| + | |||
| + | # delgroup | ||
| + | |||
| + | # addgroup < | ||
| + | |||
| + | # adduser -G < | ||
| + | |||
| + | # delgroup < | ||
| + | </ | ||
| + | |||
| + | Any user can be member of any group and the combination of user and group permissions allows for granular access to system resources. | ||
| + | |||
| + | === Passwd === | ||
| + | |||
| + | To change the current user' | ||
| < | < | ||
| - | # 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 56: | 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 76: | 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 date. | + | 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 116: | Line 238: | ||
| === Rdate === | === Rdate === | ||
| - | To syncronize | + | To synchronize |
| < | < | ||
| - | 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 via a network. It is a client-server application which uses UDP port 123. Although Slitaz is a small distribution, | + | |
| - | 1: busybox ntpd (built in) Using busybox ntpd from the command line: | + | 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. | ||
| + | </ | ||
| + | |||
| + | |||
| + | Although Slitaz is a small distribution, | ||
| + | |||
| + | Most notably: | ||
| + | |||
| + | 1: busybox ntpd (included | ||
| < | < | ||
| # busybox ntpd -p nl.pool.ntp.org | # busybox ntpd -p nl.pool.ntp.org | ||
| Line 133: | Line 269: | ||
| </ | </ | ||
| - | 2: ntp.tazpkg (install from packages repository) To install ntp.tazpkg: | + | 2: ntp.tazpkg (install from packages repository). To install ntp.tazpkg: |
| - | < | + | < |
| - | Package | + | This package |
| + | < | ||
| + | # tazpkg list-files ntp | ||
| + | |||
| + | Installed files with: ntp | ||
| + | ========================= | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | </ | ||
| + | Be aware that Slitaz has several NTP daemons available. | ||
| + | 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 === | ||
| - | Be aware that Slitaz has several ntp daemons available. We have the Busybox app or the ntp package. It is unclear which one was intended by the developers to be started by the Server Manager. | + | Probably |
| + | 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 | + | 1: Make sure to install the package |
| - | 2: Edit / | + | 2: Edit '' |
| + | < | ||
| Add one line at the end: | Add one line at the end: | ||
| - | < | + | NTP_OPTIONS=" |
| + | </ | ||
| - | 3: Edit / | + | <note tip> |
| + | The NTP daemon reads it's options from **/ | ||
| + | The configuration file **/ | ||
| + | </ | ||
| + | |||
| + | 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: | ||
| - | < | + | RUN_DAEMONS=" |
| + | </ | ||
| + | <note tip> | ||
| + | Make sure to enter just ntp, not ntp**d**! The name is a reference to **/ | ||
| + | </ | ||
| + | These are the required steps. Reboot to verify everything is indeed working as expected. | ||
| - | <note> Make sure to enter just ntp, not ntpd! The name is a reference to /etc/init.d/ntp </note> | + | Use the following to check if the daemon is running: |
| + | <code> | ||
| + | $ ps -ef | grep ntpd | ||
| + | 1934 root | ||
| + | 2193 root 0:00 grep ntpd | ||
| + | </code> | ||
| + | In this example, the first line shows the process we want to see. | ||
| - | The ntp daemon gets it options from /etc/daemons.conf. The configuration file /etc/ntp.conf which is referred | + | <note tip> |
| + | Use **/etc/init.d/ntp {start | stop | restart}** | ||
| + | Using ntpd on the command line without the full path causes the busybox version | ||
| + | </ | ||
| - | < | ||
| + | === Verifying ntpd operation === | ||
| + | |||
| + | The '' | ||
| + | < | ||
| + | # ntpq -p nl.pool.ntp.org | ||
| + | | ||
| + | ============================================================================== | ||
| + | *ntp0.nl.uu.net | ||
| + | +ntp1.nl.uu.net | ||
| + | -chime1.surfnet. 194.171.167.130 | ||
| + | +chime4.surfnet. .PPS. 1 u 422 1024 367 9.652 | ||
| + | | ||
| + | </ | ||
| + | |||
| + | The * at the start of a line indicates the server the system is currently synchronized to. | ||
| + | |||
| + | The column " | ||
| + | |||
| + | 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 syncronize | + | The '' |
| - | Syncronize | + | Synchronise |
| < | < | ||
| - | Syncronize | + | 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: | + | Alternative three: |
| - | < | + | < |
| + | # rdate -s nl.pool.ntp.org && hwclock -w -u | ||
| + | </ | ||
| - | Note that in all examples | + | Note that in all examples the '' |
| + | |||
| + | Further reading: https:// | ||
| ===== 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 of the system | + | Each user can have his or her own tasks; they are defined in the file '' |
| + | This file can be created to order modified by any user with the '' | ||
| + | The crontab utility allows (amongst other things), to list the user' | ||
| + | < | ||
| + | # crontab -l <== To list the crontab for user root. | ||
| + | OR: | ||
| + | # crontab -l -u tux <== To list the crontab for another user. | ||
| + | OR: | ||
| + | tux:~$ crontab -l <== To list the crontab for user tux. | ||
| + | </ | ||
| + | |||
| + | The syntax of the crontab | ||
| < | < | ||
| - | We will create a file with root priviledges | + | 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 crond: | + | To stop or restart the daemon |
| < | < | ||
| Line 224: | 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 | ||
| < | < | ||