website annotate en/doc/handbook/system-admin.html @ rev 156

en: Tidy website grammar
author Paul Issott <paul@slitaz.org>
date Tue Sep 09 10:36:54 2008 +0000 (2008-09-09)
parents 1aee368acd7c
children 0b70fb72663e
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" />
MikeDSmith25@117 9 <meta name="modified" content="2008-07-18 06:00: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>
MikeDSmith25@117 34 <li><a href="#devices">Devices and disk access.</a></li>
MikeDSmith25@117 35 <li><a href="#users-admin">Users, groups and passwords.</a></li>
MikeDSmith25@117 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>
MikeDSmith25@117 44 <h3>Devices and disk 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
paul@128 69 manipulation tools dependent on <code>fuse</code>. 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
MikeDSmith25@117 133 as <code>root</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.
paul@124 155 To view the available timezones, you can look in the
MikeDSmith25@117 156 <code>/usr/share/zoneinfo</code> directory.
pankso@7 157 Here's an example using the timezone Europe/London:
pankso@7 158 </p>
paul@15 159 <pre>
paul@15 160 # echo "Europe/London" &gt; /etc/TZ
pankso@7 161 </pre>
pankso@7 162 <h4>Rdate</h4>
pankso@7 163 <p>
pankso@7 164 To syncronize the system clock with a network time server, you can as the
pankso@7 165 <code>root</code> administrator use the <code>rdate -s</code> command:
pankso@7 166 </p>
pankso@7 167 <pre>
tux@107 168 # rdate -s tick.greyware.com
pankso@7 169 </pre>
pankso@7 170 <p>
pankso@7 171 To display the time on the remote server, use the <code>rdate -p</code> command.
pankso@7 172 </p>
tux@107 173 <pre> $ rdate -p tick.greyware.com
pankso@7 174 </pre>
pankso@7 175 <h4>Hwclock</h4>
pankso@7 176 <p>
pankso@7 177 Hwclock allows you to syncronize the time of your hardware clock to the system
pankso@7 178 clock or vice versa.
pankso@7 179 </p>
pankso@7 180 <p>
pankso@7 181 Syncronize the system clock to the hardware clock ( --utc = universal time,
pankso@7 182 -l = local time):
pankso@7 183 </p>
pankso@7 184 <pre>
pankso@7 185 # hwclock -w --utc
pankso@7 186 </pre>
pankso@7 187 <p>
pankso@7 188 Syncronize the hardware clock to the system clock:
pankso@7 189 </p>
pankso@7 190 <pre>
pankso@7 191 # hwclock -s --utc
pankso@7 192 </pre>
pankso@7 193
paul@26 194 <a name="cron"></a>
paul@26 195 <h3>Execute scheduled commands</h3>
paul@26 196 <p>
paul@26 197 The daemon 'crond' allows you to run commands automatically at a scheduled specific date or time. This is very
paul@26 198 useful for routine tasks such as system administration. The directory cron uses is
paul@26 199 <code>/var/spool/cron/crontabs</code>.
paul@26 200 </p>
paul@26 201 <p>
paul@26 202 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 203 The crontab utility allows you amongst other things, to list the tasks specific to the user. The syntax of the
paul@26 204 files is as follows:
paul@26 205 </p>
paul@26 206 <pre class="script">mm hh dd MMM DDD command &gt; log
paul@26 207 </pre>
paul@26 208 <p>
paul@26 209 We will create a file with root priviledges and test the daemon 'crond' with a task performed every minute -
paul@26 210 writing the date to a file /tmp/crond.test. It should be noted that the utility has an option
paul@155 211 <code>crontab</code> for editing cron file using 'vi', this is not provided by SliTaz. In its place you can use
paul@26 212 GNU nano (&lt;Ctrl+X&gt; to save &amp; exit):
paul@26 213 </p>
paul@26 214 <pre> # nano /var/spool/cron/crontabs/root
paul@26 215 </pre>
paul@26 216 <pre class="script">* * * * * date &gt;&gt; /tmp/crond.test
paul@26 217 </pre>
paul@26 218 <p>
paul@26 219 Launch <code>crond</code> with the option <code>-b</code> (background),
paul@26 220 configured via <code>/etc/daemons.conf</code> and using the startup script:
paul@26 221 </p>
paul@26 222 <pre> # /etc/init.d/crond start
paul@26 223 </pre>
paul@26 224 <p>
paul@26 225 You can wait a few minutes and view the contents of the file: /tmp/crond.test... OK:
paul@26 226 </p>
paul@26 227 <pre> # cat /tmp/crond.test
paul@26 228 </pre>
paul@26 229 <p>
paul@26 230 To stop or restart the daemon crond:
paul@26 231 </p>
paul@26 232 <pre> # /etc/init.d/crond stop
paul@26 233 Or :
paul@26 234 # /etc/init.d/crond restart
paul@26 235 </pre>
paul@26 236 <h4>Invoke the daemon crond on every boot</h4>
paul@26 237 <p>
paul@26 238 To launch the daemon 'crond' each time you boot the system, just add it to the variable <code>START_DAEMONS</code>
paul@26 239 in the configuration file <code>/etc/rcS.conf</code>, either before or after the web server or SSH server.
paul@26 240 </p>
paul@26 241
paul@26 242 <a name="local.sh"></a>
paul@26 243 <h3>Add commands to be executed at boot</h3>
paul@26 244 <p>
paul@26 245 During the boot process, various scripts are executed to configure services, such as the start of the
paul@156 246 web server, networking, etc. On SliTaz there is a script <code>/etc/init.d/local.sh</code> which allows
paul@26 247 you to add commands to be launched at system startup. You can also create new scripts in /etc/init.d,
paul@26 248 their links in /etc/rc.scripts for shell scripts and use /etc/rc.d for links to the startup script daemon in
paul@26 249 /etc/rcS.conf:
paul@26 250 </p>
paul@26 251 <pre> # nano /etc/init.d/local.sh
paul@26 252 </pre>
paul@26 253
pankso@7 254 <!-- End of content -->
pankso@7 255 </div>
pankso@7 256
pankso@7 257 <!-- Footer. -->
pankso@7 258 <div id="footer">
pankso@7 259 <div class="footer-right"></div>
pankso@7 260 <a href="#top">Top of the page</a> |
pankso@7 261 <a href="index.html">Table of contents</a>
pankso@7 262 </div>
pankso@7 263
pankso@7 264 <div id="copy">
pankso@7 265 Copyright &copy; 2008 <a href="http://www.slitaz.org/en/">SliTaz</a> -
pankso@7 266 <a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a>;<br />
pankso@7 267 Documentation is under
pankso@7 268 <a href="http://www.gnu.org/copyleft/fdl.html">GNU Free Documentation License</a>
pankso@7 269 and code is <a href="http://validator.w3.org/">valid xHTML 1.0</a>.
pankso@7 270 </div>
pankso@7 271
pankso@7 272 </body>
pankso@7 273 </html>