~ubuntu.cat/ubuntaires/ajuda

« back to all changes in this revision

Viewing changes to intrepid/serverguide/C/remote-administration.xml

  • Committer: Arnau Alcázar Lleopart
  • Date: 2009-07-17 11:09:35 UTC
  • Revision ID: arnau@alcalleop.net-20090717110935-gnslz4lobcm7wj8y
Afegit la traducció de la intrepid

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="UTF-8"?>
 
2
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" 
 
3
        "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
 
4
<!ENTITY % globalent SYSTEM "../../libs/global.ent">
 
5
%globalent;
 
6
<!ENTITY % gnome-menus-C SYSTEM "../../libs/gnome-menus-C.ent">
 
7
%gnome-menus-C;
 
8
<!ENTITY % xinclude SYSTEM "../../libs/xinclude.mod">
 
9
%xinclude;
 
10
<!ENTITY language "&EnglishAmerican;">
 
11
]>
 
12
<chapter id="remote-administration" status="review">
 
13
        <title>Remote Administration</title>
 
14
        <para>
 
15
        There are many ways to remotely administer a Linux server.  This chapter will cover
 
16
        one of the most popular <application>SSH</application> as well as 
 
17
        <application>eBox</application>, a web based administration framework.
 
18
        </para>
 
19
        <sect1 id="openssh-server" status="review">
 
20
                <title>OpenSSH Server</title>
 
21
      <sect2 id="openssh-introduction">
 
22
        <title>Introduction</title> 
 
23
           <para>
 
24
            This section of the Ubuntu &sg-title; introduces a powerful collection of tools
 
25
            for the remote control of networked computers and transfer of data between 
 
26
            networked computers, called <emphasis>OpenSSH</emphasis>. You will also learn
 
27
            about some of the configuration settings possible with the OpenSSH server 
 
28
            application and how to change them on your Ubuntu system. 
 
29
          </para>
 
30
          <para>
 
31
            OpenSSH is a freely available version of the Secure Shell (SSH) protocol family of 
 
32
            tools for remotely controlling a computer or transferring files between computers.
 
33
            Traditional tools used to accomplish these functions, such as 
 
34
            <application>telnet</application> or <application>rcp</application>, are insecure 
 
35
            and transmit the user's password in cleartext when used. OpenSSH provides a server 
 
36
            daemon and client tools to facilitate secure, encrypted remote control and file 
 
37
            transfer operations, effectively replacing the legacy tools.
 
38
          </para>
 
39
          <para>
 
40
            The OpenSSH server component, <application>sshd</application>, listens 
 
41
            continuously for client connections from any of the client tools. When a connection 
 
42
            request occurs, <application>sshd</application> sets up the correct connection 
 
43
            depending on the type of client tool connecting. For example, if the remote 
 
44
            computer is connecting with the <application>ssh</application> client application, 
 
45
            the OpenSSH server sets up a remote control session after authentication. If a 
 
46
            remote user connects to an OpenSSH server with <application>scp</application>, the 
 
47
            OpenSSH server daemon initiates a secure copy of files between the server and 
 
48
            client after authentication. OpenSSH can use many authentication methods, including             plain password, public key, and <application>Kerberos</application> tickets.
 
49
            </para>
 
50
          </sect2>
 
51
        <sect2 id="openssh-installation">
 
52
        <title>Installation</title>
 
53
        <para>
 
54
        Installation of the OpenSSH client and server applications is simple. To install the 
 
55
        OpenSSH client applications on your Ubuntu system, use this command at a terminal 
 
56
        prompt:
 
57
        </para>
 
58
<screen>
 
59
<command>sudo apt-get install openssh-client</command>
 
60
</screen>
 
61
        <para>
 
62
        To install the OpenSSH server application, and related support files, use this command 
 
63
        at a terminal prompt:
 
64
        </para>
 
65
<screen>
 
66
<command>sudo apt-get install openssh-server</command>
 
67
</screen>
 
68
        <para>
 
69
        The <application>openssh-server</application> package can also be selected to 
 
70
        install during the Server Edition installation process.
 
71
        </para>
 
72
        </sect2>
 
73
        <sect2 id="openssh-configuration">
 
74
          <title>Configuration</title>
 
75
          <para>
 
76
          You may configure the default behavior of the OpenSSH server application, 
 
77
          <application>sshd</application>, by editing the file 
 
78
          <filename>/etc/ssh/sshd_config</filename>. For information about the configuration 
 
79
          directives used in this file, you may view the appropriate manual page with the 
 
80
          following command, issued at a terminal prompt:
 
81
          </para>
 
82
<screen>
 
83
<command>man sshd_config</command>
 
84
</screen>
 
85
            <para>
 
86
            There are many directives in the <application>sshd</application> configuration 
 
87
            file controlling such things as communications settings and authentication modes. 
 
88
            The following are examples of configuration directives that can be changed by 
 
89
            editing the <filename>/etc/ssh/ssh_config</filename> file.
 
90
            </para>
 
91
            <tip>
 
92
                <para>Prior to editing the configuration file, you should make a copy of the 
 
93
                original file and protect it from writing so you will have the original 
 
94
                settings as a reference and to reuse as necessary.
 
95
                </para>
 
96
                <para>Copy the <filename>/etc/ssh/sshd_config</filename> file and protect it 
 
97
                from writing with the following commands, issued at a terminal prompt:
 
98
                </para>
 
99
            </tip>
 
100
<screen>
 
101
<command>sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.original</command>
 
102
<command>sudo chmod a-w /etc/ssh/sshd_config.original</command>
 
103
</screen>
 
104
            <para>
 
105
            The following are examples of configuration directives you may change:
 
106
            </para>
 
107
           <itemizedlist>
 
108
               <listitem>
 
109
               <para>
 
110
               To set your OpenSSH to listen on TCP port 2222 instead of the default TCP port 
 
111
               22, change the Port directive as such:
 
112
               </para>
 
113
               <para>
 
114
               Port 2222
 
115
               </para>
 
116
               </listitem>
 
117
        <listitem>
 
118
            <para>
 
119
            To have <application>sshd</application> allow public key-based login credentials, 
 
120
            simply add or modify the line:
 
121
            </para>
 
122
               <para>
 
123
               PubkeyAuthentication yes
 
124
               </para>
 
125
            <para>
 
126
            In the <filename>/etc/ssh/sshd_config</filename> file, or if already present, 
 
127
            ensure the line is not commented out.
 
128
            </para>
 
129
            </listitem>
 
130
            <listitem>
 
131
             <para>
 
132
             To make your OpenSSH server display the contents of the 
 
133
             <filename>/etc/issue.net</filename> file as a pre-login
 
134
             banner, simply add or modify the line:
 
135
             </para>
 
136
               <para>
 
137
               Banner  /etc/issue.net
 
138
               </para>
 
139
               <para>
 
140
               In the <filename>/etc/ssh/sshd_config</filename> file.
 
141
               </para>
 
142
             </listitem>
 
143
             </itemizedlist>
 
144
            <para>
 
145
            After making changes to the <filename>/etc/ssh/sshd_config</filename> file, save 
 
146
            the file, and restart the <application>sshd</application> server application to 
 
147
            effect the changes using the following command at a terminal prompt:
 
148
            </para>
 
149
<screen>
 
150
<command>sudo /etc/init.d/ssh restart</command>
 
151
</screen>
 
152
                <warning>
 
153
                  <para>
 
154
                  Many other configuration directives for <application>sshd</application> are 
 
155
                  available for changing the server application's behavior to fit your needs. 
 
156
                  Be advised, however, if your only method of access to a server is 
 
157
                  <application>ssh</application>, and you make a mistake in configuring 
 
158
                  <application>sshd</application> via the 
 
159
                  <filename>/etc/ssh/sshd_config</filename> file, you may find you
 
160
                  are locked out of the server upon restarting it, or that the 
 
161
                  <application>sshd</application> server refuses to start due to an incorrect 
 
162
                  configuration directive, so be extra careful when editing this file on a 
 
163
                  remote server.
 
164
                  </para>
 
165
                </warning>
 
166
        </sect2>
 
167
   <sect2 id="openssh-keys" status="review">
 
168
     <title>SSH Keys</title>
 
169
     <para>
 
170
     SSH <emphasis>keys</emphasis> allow authentication between two hosts without the need of a password.  SSH key authentication 
 
171
     uses two keys a <emphasis>private</emphasis> key and a <emphasis>public</emphasis> key.
 
172
     </para>
 
173
     <para>
 
174
     To generate the keys, from a terminal prompt enter:
 
175
     </para>
 
176
<screen>
 
177
<command>ssh-keygen -t dsa</command>
 
178
</screen>
 
179
     <para>
 
180
     This will generate the keys using a <emphasis>DSA</emphasis> authentication identity of the user.  During the process you
 
181
     will be prompted for a password.  Simply hit <emphasis>Enter</emphasis> when prompted to create the key.  
 
182
     </para>
 
183
     <para>
 
184
     By default the <emphasis>public</emphasis> key is saved in the file <filename>~/.ssh/id_dsa.pub</filename>, while 
 
185
     <filename>~/.ssh/id_dsa</filename> is the <emphasis>private</emphasis> key.  Now copy the <filename>id_dsa.pub</filename> file
 
186
     to the remote host and appended it to <filename>~/.ssh/authorized_keys2</filename>:
 
187
     </para>
 
188
<screen>
 
189
<command>cat id_dsa.pub >> .ssh/authorized_keys2</command>
 
190
</screen>
 
191
     <para>
 
192
     Finally, double check the permissions on the <filename>authorized_keys2</filename> file, only the authenticated user should have read and write permissions.
 
193
     If the permissions are not correct change them by:
 
194
     </para>
 
195
<screen>
 
196
<command>chmod 644 .ssh/authorized_keys2</command>
 
197
</screen>
 
198
     <para>
 
199
     You should now be able to SSH to the host without being prompted for a password.
 
200
     </para>
 
201
   </sect2>
 
202
   <sect2 id="openssh-references" status="review">
 
203
      <title>References</title>
 
204
      <para>
 
205
      <ulink url="http://www.openssh.org/">OpenSSH Website</ulink>
 
206
      </para>
 
207
      <para>
 
208
      <ulink url="https://wiki.ubuntu.com/AdvancedOpenSSH">Advanced OpenSSH Wiki Page</ulink>
 
209
      </para>
 
210
   </sect2>
 
211
  </sect1>
 
212
  <sect1 id="ebox" status="review">
 
213
    <title>eBox</title>
 
214
    <para>
 
215
    <application>eBox</application> is a web framework used to manager server application 
 
216
    configuration. The modular design of eBox allows you to pick and choose which services you 
 
217
    want to configure using eBox.
 
218
    </para>
 
219
    <sect2 id="ebox-installation" status="review">
 
220
      <title>Installation</title>
 
221
      <para>
 
222
      The different <application>eBox</application> modules are split into different packages, 
 
223
      allowing you to only install those necessary. One way to view the available packages is 
 
224
      to enter the following from a terminal:
 
225
      </para>
 
226
<screen>
 
227
<command>apt-cache rdepends ebox | uniq</command>
 
228
</screen>
 
229
      <para>
 
230
      To install the <application>ebox</application> package, which contains the default 
 
231
      modules, enter the following:
 
232
      </para>
 
233
<screen>
 
234
<command>sudo apt-get install ebox</command>
 
235
</screen>
 
236
      <para>
 
237
      If you want to install all the available modules, the <application>ebox-all</application> 
 
238
      meta package will install all the modules.
 
239
      </para>
 
240
      <para>
 
241
      During the installation you will be asked to supply a password for the ebox user. After 
 
242
      installing eBox the web interface can be accessed from: 
 
243
      <emphasis>https://yourserver/ebox</emphasis>.
 
244
      </para>
 
245
    </sect2>
 
246
    <sect2 id="ebox-configuration" status="review">
 
247
      <title>Configuration</title>
 
248
      <para>
 
249
      An important thing to remember when using <application>eBox</application> is that when 
 
250
      configuring most modules there is a <emphasis>Change</emphasis> button that implements 
 
251
      the new configuration. After clicking the Change button most, but not all, modules will 
 
252
      then need to be <emphasis>Saved</emphasis>. To save the new configuration click on the 
 
253
      <quote>Save changes</quote> link in the top right hand corner. 
 
254
      </para>
 
255
      <note>
 
256
        <para>
 
257
        Once you make a change that requires a Save, the link will change from green to red. 
 
258
        </para>
 
259
      </note>
 
260
    </sect2>
 
261
    <sect2 id="ebox-modules" status="review">
 
262
      <title>eBox Modules</title>
 
263
      <para>
 
264
      By default all eBox <emphasis>Modules</emphasis> are not enabled, and when a new module 
 
265
      is installed it will not be automatically enabled.
 
266
      </para>
 
267
      <para>
 
268
      To enable a disabled module click on the <emphasis>Module status</emphasis> link in the 
 
269
      left hand menu. Then <emphasis role="italic">check</emphasis> which modules you would 
 
270
      like to enable and click the <quote>Save</quote> link. 
 
271
      </para>
 
272
      <sect3 id="ebox-default-modules" status="review">
 
273
        <title>Default Modules</title>
 
274
        <para>
 
275
        This section provides a quick summary of the default <application>eBox</application> 
 
276
        modules.
 
277
        </para> 
 
278
        <itemizedlist>
 
279
          <listitem>
 
280
            <para>
 
281
            <emphasis>System:</emphasis> contains options allowing configuration of general 
 
282
            eBox items.
 
283
            </para>
 
284
            <itemizedlist>
 
285
              <listitem>
 
286
                <para>
 
287
                <emphasis>General:</emphasis> allows you to set the language, port 
 
288
                number, and contains a change password form.
 
289
                </para>
 
290
              </listitem>
 
291
              <listitem>
 
292
                <para>
 
293
                <emphasis>Disk Usage:</emphasis> displays a graph detailing information about 
 
294
                disk usage.
 
295
                </para>
 
296
              </listitem>
 
297
              <listitem>
 
298
                <para>
 
299
                <emphasis>Backup:</emphasis> is used to backup <application>eBox</application> 
 
300
                configuration information, and the <emphasis>Full Backup</emphasis> option 
 
301
                allows you to save all eBox information not included in the 
 
302
                <emphasis>Configuration</emphasis> option such as log files.
 
303
                </para>
 
304
              </listitem>
 
305
              <listitem>
 
306
                <para>
 
307
                <emphasis>Halt/Reboot:</emphasis> will shutdown the system or reboot it.
 
308
                </para>
 
309
              </listitem>
 
310
              <listitem>
 
311
                <para>
 
312
                <emphasis>Bug Report:</emphasis> creates a file containing details helpful 
 
313
                when reporting bugs to the eBox developers.
 
314
                </para>
 
315
              </listitem>
 
316
            </itemizedlist>
 
317
          </listitem>
 
318
          <listitem>
 
319
            <para>
 
320
            <emphasis>Logs:</emphasis> allows <application>eBox</application> logs to be 
 
321
            queried depending on the purge time configured.
 
322
            </para>
 
323
          </listitem>
 
324
          <listitem>
 
325
            <para>
 
326
            <emphasis>Events:</emphasis> this module has the ability to send alerts through 
 
327
            rss, jabber, and log file.
 
328
            </para>
 
329
            <itemizedlist>
 
330
              <listitem>
 
331
                <para>
 
332
                <emphasis>Available Events:</emphasis>
 
333
                </para>
 
334
                <itemizedlist>
 
335
                  <listitem>
 
336
                    <para>
 
337
                    <emphasis>Free Storage Space:</emphasis> will send alert if free disk 
 
338
                    space drops below a configured percentage, 10% by default.
 
339
                    </para>
 
340
                  </listitem>
 
341
                  <listitem>
 
342
                    <para>
 
343
                    <emphasis>Log Observer:</emphasis> unfortunately this event does not work 
 
344
                    with the <application>eBox</application> version shipped with Ubuntu 7.10.
 
345
                    </para>
 
346
                  </listitem>
 
347
                  <listitem>
 
348
                    <para>
 
349
                    <emphasis>RAID:</emphasis> will monitor the RAID system and send alerts if 
 
350
                    any issues arise.
 
351
                    </para>
 
352
                  </listitem>
 
353
                  <listitem>
 
354
                    <para>
 
355
                    <emphasis>Service:</emphasis> sends alerts if a service restarts multiple 
 
356
                    times in a short time period.
 
357
                    </para>
 
358
                  </listitem>
 
359
                  <listitem>
 
360
                    <para>
 
361
                    <emphasis>State:</emphasis> alerts on the state of 
 
362
                    <application>eBox</application>, either up or down.
 
363
                    </para>
 
364
                  </listitem>
 
365
                </itemizedlist>
 
366
              </listitem>
 
367
              <listitem>
 
368
                <para>
 
369
                <emphasis>Dispatchers:</emphasis>
 
370
                </para>
 
371
                <itemizedlist>
 
372
                  <listitem>
 
373
                    <para>
 
374
                    <emphasis>Log:</emphasis> this dispatcher will send event messages to the 
 
375
                    <application>eBox</application> log file 
 
376
                    <filename>/var/log/ebox/ebox.log</filename>.
 
377
                    </para>
 
378
                  </listitem>
 
379
                  <listitem>
 
380
                    <para>
 
381
                    <emphasis>Jabber:</emphasis> before enabling this dispatcher you must
 
382
                    first configure it by clicking on the <quote>Configure</quote> icon.
 
383
                    </para>
 
384
                  </listitem>
 
385
                  <listitem>
 
386
                    <para>
 
387
                    <emphasis>RSS:</emphasis> once this dispatcher is configured you can 
 
388
                    subscribe to the link in order to view event alerts.
 
389
                    </para>
 
390
                  </listitem>
 
391
                </itemizedlist>
 
392
              </listitem>
 
393
            </itemizedlist>
 
394
          </listitem>
 
395
        </itemizedlist>
 
396
      </sect3>
 
397
    </sect2>
 
398
    <sect2 id="ebox-additional-modules" status="review">
 
399
      <title>Additional Modules</title>
 
400
      <para>
 
401
      Here is a quick description of other available <application>eBox</application> modules:
 
402
      </para> 
 
403
      <itemizedlist>
 
404
        <listitem>
 
405
          <para>
 
406
          <emphasis>Network:</emphasis> allows configuration of the server's network options 
 
407
          through eBox.
 
408
          </para>
 
409
        </listitem>
 
410
        <listitem>
 
411
          <para>
 
412
          <emphasis>Firewall:</emphasis> configures firewall options for the eBox host.
 
413
          </para>
 
414
        </listitem>
 
415
        <listitem>
 
416
          <para>
 
417
          <emphasis>UsersandGroups:</emphasis> this module will manage users and groups 
 
418
          contained in an <application>OpenLDAP</application> LDAP directory.
 
419
          </para>
 
420
        </listitem>
 
421
        <listitem>
 
422
          <para>
 
423
          <emphasis>DHCP:</emphasis> provides an interface for configuring a DHCP server. 
 
424
          </para>
 
425
        </listitem>
 
426
        <listitem>
 
427
          <para>
 
428
          <emphasis>DNS:</emphasis> provides <application>BIND9</application> DNS server 
 
429
          configuration options.
 
430
          </para>
 
431
        </listitem>
 
432
        <listitem>
 
433
          <para>
 
434
          <emphasis>Objects:</emphasis> allow configuration of eBox 
 
435
          <emphasis>Network Objects</emphasis>, which allow you to assign a name to an IP 
 
436
          address or group of IPs.
 
437
          </para>
 
438
        </listitem>
 
439
        <listitem>
 
440
          <para>
 
441
          <emphasis>Services:</emphasis> displays configuration information for services that 
 
442
          are available to the network.
 
443
          </para>
 
444
        </listitem>
 
445
        <listitem>
 
446
          <para>
 
447
          <emphasis>Squid:</emphasis> configuration options for the 
 
448
          <application>Squid</application> proxy server.
 
449
          </para>
 
450
        </listitem>
 
451
        <listitem>
 
452
          <para>
 
453
          <emphasis>CA:</emphasis> configures a Certificate Authority for the server.
 
454
          </para>
 
455
        </listitem>
 
456
        <listitem>
 
457
          <para>
 
458
          <emphasis>NTP:</emphasis> set Network Time Protocol options.
 
459
          </para>
 
460
        </listitem>
 
461
        <listitem>
 
462
          <para>
 
463
          <emphasis>Printers:</emphasis> allows the configuration of printers.
 
464
          </para>
 
465
        </listitem>
 
466
        <listitem>
 
467
          <para>
 
468
          <emphasis>Samba:</emphasis> configuration options for Samba.
 
469
          </para>
 
470
        </listitem>
 
471
        <listitem>
 
472
          <para>
 
473
          <emphasis>OpenVPN:</emphasis> setup options for OpenVPN Virtual Private Network 
 
474
          application.
 
475
          </para>
 
476
        </listitem>
 
477
      </itemizedlist>
 
478
    </sect2>
 
479
    <sect2 id="ebox-resources" status="review">
 
480
      <title>Resources</title>
 
481
      <itemizedlist>
 
482
        <listitem>
 
483
          <para>
 
484
          For more information see the 
 
485
          <ulink url="http://ebox-platform.com/">eBox Home Page</ulink>.
 
486
          </para>
 
487
        </listitem>
 
488
      </itemizedlist>
 
489
    </sect2>
 
490
  </sect1> 
 
491
</chapter>