website view en/doc/handbook/system-admin.html @ rev 117

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