website annotate en/doc/handbook/system-admin.html @ rev 107
fixed typos in system-admin pages : tick.greyware.com is the right URL
for the time server, tick.grayware.com doesn't work
for the time server, tick.grayware.com doesn't work
author | tux@HarimaKenji |
---|---|
date | Mon Jul 14 22:22:15 2008 +0200 (2008-07-14) |
parents | 16ab7f88b9d8 |
children | 9e30e64c8198 |
rev | line source |
---|---|
pankso@7 | 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
pankso@7 | 2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
pankso@7 | 3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
pankso@7 | 4 <head> |
pankso@7 | 5 <title>SliTaz Handbook (en) - System administration</title> |
pankso@7 | 6 <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /> |
pankso@7 | 7 <meta name="description" content="slitaz English handbook" /> |
pankso@7 | 8 <meta name="expires" content="never" /> |
tux@107 | 9 <meta name="modified" content="2008-07-14 22:15:00" /> |
pankso@7 | 10 <meta name="publisher" content="www.slitaz.org" /> |
pankso@7 | 11 <meta name="author" content="Christophe Lincoln"/> |
pankso@7 | 12 <link rel="shortcut icon" href="favicon.ico" /> |
pankso@7 | 13 <link rel="stylesheet" type="text/css" href="book.css" /> |
pankso@7 | 14 </head> |
pankso@7 | 15 <body bgcolor="#ffffff"> |
pankso@7 | 16 |
pankso@7 | 17 <!-- Header and quick navigation --> |
pankso@7 | 18 <div id="header"> |
pankso@7 | 19 <div align="right" id="quicknav"> |
pankso@7 | 20 <a name="top"></a> |
pankso@7 | 21 <a href="x-window.html">X Window System</a> | |
pankso@7 | 22 <a href="index.html">Table of contents</a> |
pankso@7 | 23 </div> |
pankso@7 | 24 <h1><font color="#3E1220">SliTaz Handbook (en)</font></h1> |
pankso@7 | 25 </div> |
pankso@7 | 26 |
pankso@7 | 27 <!-- Content. --> |
pankso@7 | 28 <div id="content"> |
pankso@7 | 29 <div class="content-right"></div> |
pankso@7 | 30 |
pankso@7 | 31 <h2><font color="#df8f06">System administration</font></h2> |
pankso@7 | 32 |
pankso@7 | 33 <ul> |
pankso@7 | 34 <li><a href="#devices">Devices and disks access.</a></li> |
pankso@7 | 35 <li><a href="#users-admin">Users, groups and passwords.</a></li> |
pankso@7 | 36 <li><a href="#locale">Language and keyboard.</a></li> |
pankso@16 | 37 <li><a href="#bash">Install the Bash shell.</a></li> |
pankso@16 | 38 <li><a href="#time">Set the system time.</a></li> |
paul@26 | 39 <li><a href="#cron">Execute scheduled commands.</a></li> |
paul@26 | 40 <li><a href="#local.sh">Add commands at boot time.</a></li> |
pankso@7 | 41 </ul> |
pankso@7 | 42 |
pankso@7 | 43 <a name="devices"></a> |
pankso@7 | 44 <h3>Devices and disks access</h3> |
pankso@7 | 45 <p> |
pankso@7 | 46 With Linux your disks and USB media are seen as devices. To access them you must |
pankso@7 | 47 first mount a device on a mount point (directory). On SliTaz you can graphically |
pankso@7 | 48 mount devices using <code>mountbox</code> or use the command line. To mount the |
pankso@7 | 49 first disk of a local hard disk on <code>/mnt/disk</code>: |
pankso@7 | 50 </p> |
pankso@7 | 51 <pre> |
pankso@7 | 52 # mkdir -p /mnt/disk |
pankso@7 | 53 # mount /dev/hda1 /mnt/disk |
pankso@7 | 54 </pre> |
pankso@7 | 55 <p> |
pankso@7 | 56 To mount a cdrom or an USB media you should use mount points located in |
pankso@7 | 57 <code>/media</code>. Note that for a cdrom, you just have to specify |
pankso@7 | 58 the device path and for a flash key the mount point already exists: |
pankso@7 | 59 </p> |
pankso@7 | 60 <pre> |
pankso@7 | 61 # mount /dev/cdrom |
pankso@7 | 62 # mount /dev/sda1 /media/flash |
pankso@7 | 63 </pre> |
pankso@7 | 64 <h4>ntfs filesystem</h4> |
pankso@7 | 65 <p> |
pankso@7 | 66 If you need read/write access to Windows ntfs filesystems you must install a |
pankso@7 | 67 few additional packages from the mirror. The <code>ntfs-3g</code> driver |
paul@23 | 68 provides stable access to ntfs partitions and <code>ntfsprogs</code> provides |
pankso@7 | 69 manipulation tools dependent on Fuse. Note that you can format, move or resize |
pankso@7 | 70 ntfs partitions graphically with Gparted. |
pankso@7 | 71 </p> |
pankso@7 | 72 |
pankso@7 | 73 <a name="users-admin"></a> |
pankso@7 | 74 <h3>Users, groups and passwords</h3> |
pankso@7 | 75 <p> |
pankso@7 | 76 To manage users and groups on your SliTaz system you must use the command line, |
pankso@7 | 77 but file permissions can be changed graphically using the emelFM2 file manager. To |
pankso@7 | 78 add or remove users and groups you must be root. Root can also change all |
pankso@7 | 79 user passwords and a single user can only change his/her own password. To add |
pankso@7 | 80 or remove a user named linux: |
pankso@7 | 81 </p> |
paul@15 | 82 <pre> |
paul@15 | 83 # adduser linux |
pankso@7 | 84 # deluser linux |
pankso@7 | 85 </pre> |
pankso@7 | 86 <p> |
pankso@7 | 87 To add or remove a group you must use <code>addgroup</code> or |
pankso@7 | 88 <code>delgroup</code>. To change the current user password or change the |
pankso@7 | 89 password of a specific user, you must use the command <code>passwd</code>: |
pankso@7 | 90 </p> |
paul@15 | 91 <pre> |
paul@15 | 92 $ passwd |
pankso@7 | 93 # passwd username |
pankso@7 | 94 </pre> |
paul@15 | 95 <h4>Audio group</h4> |
paul@15 | 96 <p> |
paul@15 | 97 If you want a new user to be able to listen to music he must be in the |
paul@15 | 98 <code>audio</code> group. To add an existing user to the audio group: |
paul@15 | 99 </p> |
paul@15 | 100 <pre> |
paul@15 | 101 # adduser -G audio user_name |
paul@15 | 102 </pre> |
pankso@7 | 103 |
pankso@7 | 104 <a name="locale"></a> |
pankso@7 | 105 <h3>Language and keyboard layout</h3> |
pankso@7 | 106 <p> |
pankso@7 | 107 SliTaz saves the configuration of the default locale in <code>/etc/locale.conf</code> |
pankso@7 | 108 which is read by <code>/etc/profile</code> on each login and the keyboard |
pankso@7 | 109 setting is stored in <code>/etc/kmap.conf</code>. These two files can be |
pankso@7 | 110 edited with your favorite editor or configured respectively with |
pankso@7 | 111 <code>tazlocale</code> and <code>tazkmap</code>. You can modify the settings |
pankso@7 | 112 you chose on the first boot by typing as root administrator: |
pankso@7 | 113 </p> |
pankso@7 | 114 <pre> |
pankso@7 | 115 # tazlocale |
pankso@7 | 116 Or: |
pankso@7 | 117 # tazkmap |
pankso@7 | 118 </pre> |
pankso@7 | 119 <p> |
pankso@7 | 120 To check all available locales or your current configuration you can use the |
pankso@7 | 121 command <code>locale</code> as a single user or root (C for English): |
pankso@7 | 122 </p> |
paul@15 | 123 <pre> |
paul@15 | 124 $ locale -a |
pankso@7 | 125 $ locale |
pankso@7 | 126 </pre> |
paul@15 | 127 |
pankso@7 | 128 <a name="bash"></a> |
pankso@7 | 129 <h3>Bash Shell</h3> |
pankso@7 | 130 <p> |
pankso@7 | 131 On SliTaz you have the ash and sh shell with a link to Ash, this shell is |
pankso@7 | 132 provided by Busybox. If you wish to use the Bash (Bourne Again SHell), first |
pankso@7 | 133 as <code>su</code> install bash, copy the <code>.profile</code> found in your |
pankso@7 | 134 home directory and rename it <code>.bashrc</code>, then edit the |
pankso@7 | 135 <code>/etc/passwd</code> file with your favorite text editor and change your |
pankso@16 | 136 shell to :/bin/bash |
pankso@7 | 137 </p> |
pankso@7 | 138 <pre> |
pankso@7 | 139 # tazpkg get-install bash |
pankso@7 | 140 # cp /home/hacker/.profile home/hacker/.bashrc |
pankso@7 | 141 # Note root user: cp /home/hacker/.profile ~/.bashrc |
pankso@7 | 142 # nano /etc/passwd # :/bin/bash |
pankso@7 | 143 </pre> |
pankso@7 | 144 <p> |
pankso@7 | 145 The next time you login bash will be your default shell, you can confirm this |
pankso@7 | 146 by typing <code>env</code> in the command line. |
pankso@7 | 147 </p> |
pankso@7 | 148 |
pankso@7 | 149 <a name="time"></a> |
pankso@7 | 150 <h3>System Time</h3> |
pankso@7 | 151 <p> |
pankso@7 | 152 To know the current system time, you can simply type <code>date</code>. On |
pankso@7 | 153 SliTaz, the timezone configuration file is saved in <code>/etc/TZ</code>, you |
pankso@7 | 154 can edit with your favorite text editor or simply <code>echo</code> the changes. |
pankso@7 | 155 Here's an example using the timezone Europe/London: |
pankso@7 | 156 </p> |
paul@15 | 157 <pre> |
paul@15 | 158 # echo "Europe/London" > /etc/TZ |
pankso@7 | 159 </pre> |
pankso@7 | 160 <h4>Rdate</h4> |
pankso@7 | 161 <p> |
pankso@7 | 162 To syncronize the system clock with a network time server, you can as the |
pankso@7 | 163 <code>root</code> administrator use the <code>rdate -s</code> command: |
pankso@7 | 164 </p> |
pankso@7 | 165 <pre> |
tux@107 | 166 # rdate -s tick.greyware.com |
pankso@7 | 167 </pre> |
pankso@7 | 168 <p> |
pankso@7 | 169 To display the time on the remote server, use the <code>rdate -p</code> command. |
pankso@7 | 170 </p> |
tux@107 | 171 <pre> $ rdate -p tick.greyware.com |
pankso@7 | 172 </pre> |
pankso@7 | 173 <h4>Hwclock</h4> |
pankso@7 | 174 <p> |
pankso@7 | 175 Hwclock allows you to syncronize the time of your hardware clock to the system |
pankso@7 | 176 clock or vice versa. |
pankso@7 | 177 </p> |
pankso@7 | 178 <p> |
pankso@7 | 179 Syncronize the system clock to the hardware clock ( --utc = universal time, |
pankso@7 | 180 -l = local time): |
pankso@7 | 181 </p> |
pankso@7 | 182 <pre> |
pankso@7 | 183 # hwclock -w --utc |
pankso@7 | 184 </pre> |
pankso@7 | 185 <p> |
pankso@7 | 186 Syncronize the hardware clock to the system clock: |
pankso@7 | 187 </p> |
pankso@7 | 188 <pre> |
pankso@7 | 189 # hwclock -s --utc |
pankso@7 | 190 </pre> |
pankso@7 | 191 |
paul@26 | 192 <a name="cron"></a> |
paul@26 | 193 <h3>Execute scheduled commands</h3> |
paul@26 | 194 <p> |
paul@26 | 195 The daemon 'crond' allows you to run commands automatically at a scheduled specific date or time. This is very |
paul@26 | 196 useful for routine tasks such as system administration. The directory cron uses is |
paul@26 | 197 <code>/var/spool/cron/crontabs</code>. |
paul@26 | 198 </p> |
paul@26 | 199 <p> |
paul@26 | 200 Each user of the system can have his/her own tasks, they are defined in the file: <code>/var/spool/cron/crontabs/user</code>. |
paul@26 | 201 The crontab utility allows you amongst other things, to list the tasks specific to the user. The syntax of the |
paul@26 | 202 files is as follows: |
paul@26 | 203 </p> |
paul@26 | 204 <pre class="script">mm hh dd MMM DDD command > log |
paul@26 | 205 </pre> |
paul@26 | 206 <p> |
paul@26 | 207 We will create a file with root priviledges and test the daemon 'crond' with a task performed every minute - |
paul@26 | 208 writing the date to a file /tmp/crond.test. It should be noted that the utility has an option |
paul@26 | 209 <code>crontab</code> for editing cron file using 'vi', this is not provided by SliTaz. In it's place you can use |
paul@26 | 210 GNU nano (<Ctrl+X> to save & exit): |
paul@26 | 211 </p> |
paul@26 | 212 <pre> # nano /var/spool/cron/crontabs/root |
paul@26 | 213 </pre> |
paul@26 | 214 <pre class="script">* * * * * date >> /tmp/crond.test |
paul@26 | 215 </pre> |
paul@26 | 216 <p> |
paul@26 | 217 Launch <code>crond</code> with the option <code>-b</code> (background), |
paul@26 | 218 configured via <code>/etc/daemons.conf</code> and using the startup script: |
paul@26 | 219 </p> |
paul@26 | 220 <pre> # /etc/init.d/crond start |
paul@26 | 221 </pre> |
paul@26 | 222 <p> |
paul@26 | 223 You can wait a few minutes and view the contents of the file: /tmp/crond.test... OK: |
paul@26 | 224 </p> |
paul@26 | 225 <pre> # cat /tmp/crond.test |
paul@26 | 226 </pre> |
paul@26 | 227 <p> |
paul@26 | 228 To stop or restart the daemon crond: |
paul@26 | 229 </p> |
paul@26 | 230 <pre> # /etc/init.d/crond stop |
paul@26 | 231 Or : |
paul@26 | 232 # /etc/init.d/crond restart |
paul@26 | 233 </pre> |
paul@26 | 234 <h4>Invoke the daemon crond on every boot</h4> |
paul@26 | 235 <p> |
paul@26 | 236 To launch the daemon 'crond' each time you boot the system, just add it to the variable <code>START_DAEMONS</code> |
paul@26 | 237 in the configuration file <code>/etc/rcS.conf</code>, either before or after the web server or SSH server. |
paul@26 | 238 </p> |
paul@26 | 239 |
paul@26 | 240 <a name="local.sh"></a> |
paul@26 | 241 <h3>Add commands to be executed at boot</h3> |
paul@26 | 242 <p> |
paul@26 | 243 During the boot process, various scripts are executed to configure services, such as the start of the |
paul@26 | 244 web server, networking etc. On SliTaz there is a script <code>/etc/init.d/local.sh</code> which allows |
paul@26 | 245 you to add commands to be launched at system startup. You can also create new scripts in /etc/init.d, |
paul@26 | 246 their links in /etc/rc.scripts for shell scripts and use /etc/rc.d for links to the startup script daemon in |
paul@26 | 247 /etc/rcS.conf: |
paul@26 | 248 </p> |
paul@26 | 249 <pre> # nano /etc/init.d/local.sh |
paul@26 | 250 </pre> |
paul@26 | 251 |
pankso@7 | 252 <!-- End of content --> |
pankso@7 | 253 </div> |
pankso@7 | 254 |
pankso@7 | 255 <!-- Footer. --> |
pankso@7 | 256 <div id="footer"> |
pankso@7 | 257 <div class="footer-right"></div> |
pankso@7 | 258 <a href="#top">Top of the page</a> | |
pankso@7 | 259 <a href="index.html">Table of contents</a> |
pankso@7 | 260 </div> |
pankso@7 | 261 |
pankso@7 | 262 <div id="copy"> |
pankso@7 | 263 Copyright © 2008 <a href="http://www.slitaz.org/en/">SliTaz</a> - |
pankso@7 | 264 <a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a>;<br /> |
pankso@7 | 265 Documentation is under |
pankso@7 | 266 <a href="http://www.gnu.org/copyleft/fdl.html">GNU Free Documentation License</a> |
pankso@7 | 267 and code is <a href="http://validator.w3.org/">valid xHTML 1.0</a>. |
pankso@7 | 268 </div> |
pankso@7 | 269 |
pankso@7 | 270 </body> |
pankso@7 | 271 </html> |