1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
5 | %general-entities;
|
---|
6 |
|
---|
7 | <!ENTITY openssh-download-http
|
---|
8 | "http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-&openssh-version;.tar.gz">
|
---|
9 | <!ENTITY openssh-download-ftp
|
---|
10 | "ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-&openssh-version;.tar.gz">
|
---|
11 | <!ENTITY openssh-md5sum "3345cbf4efe90ffb06a78670ab2d05d5">
|
---|
12 | <!ENTITY openssh-size "1.1 MB">
|
---|
13 | <!ENTITY openssh-buildsize "39 MB">
|
---|
14 | <!ENTITY openssh-time "0.4 SBU">
|
---|
15 | ]>
|
---|
16 |
|
---|
17 | <sect1 id="openssh" xreflabel="OpenSSH-&openssh-version;">
|
---|
18 | <?dbhtml filename="openssh.html"?>
|
---|
19 |
|
---|
20 | <sect1info>
|
---|
21 | <othername>$LastChangedBy$</othername>
|
---|
22 | <date>$Date$</date>
|
---|
23 | </sect1info>
|
---|
24 |
|
---|
25 | <title>OpenSSH-&openssh-version;</title>
|
---|
26 |
|
---|
27 | <para>
|
---|
28 | The <application>OpenSSH</application> package contains
|
---|
29 | <command>ssh</command> clients and the <command>sshd</command> daemon. This
|
---|
30 | is useful for encrypting authentication and subsequent traffic over a
|
---|
31 | network. The <command>ssh</command> and <command>scp</command> commands are
|
---|
32 | secure implementions of <command>telnet</command> and <command>rcp</command>
|
---|
33 | respectively.
|
---|
34 | </para>
|
---|
35 |
|
---|
36 | &lfs72_checked;
|
---|
37 |
|
---|
38 | <indexterm zone="openssh">
|
---|
39 | <primary sortas="a-OpenSSH">OpenSSH</primary>
|
---|
40 | </indexterm>
|
---|
41 |
|
---|
42 | <sect2 role="package">
|
---|
43 | <title>Introduction to OpenSSH</title>
|
---|
44 |
|
---|
45 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
46 | <itemizedlist spacing="compact">
|
---|
47 | <listitem>
|
---|
48 | <para>
|
---|
49 | Download (HTTP): <ulink url="&openssh-download-http;"/>
|
---|
50 | </para>
|
---|
51 | </listitem>
|
---|
52 | <listitem>
|
---|
53 | <para>
|
---|
54 | Download (FTP): <ulink url="&openssh-download-ftp;"/>
|
---|
55 | </para>
|
---|
56 | </listitem>
|
---|
57 | <listitem>
|
---|
58 | <para>
|
---|
59 | Download MD5 sum: &openssh-md5sum;
|
---|
60 | </para>
|
---|
61 | </listitem>
|
---|
62 | <listitem>
|
---|
63 | <para>
|
---|
64 | Download size: &openssh-size;
|
---|
65 | </para>
|
---|
66 | </listitem>
|
---|
67 | <listitem>
|
---|
68 | <para>
|
---|
69 | Estimated disk space required: &openssh-buildsize;
|
---|
70 | </para>
|
---|
71 | </listitem>
|
---|
72 | <listitem>
|
---|
73 | <para>
|
---|
74 | Estimated build time: &openssh-time;
|
---|
75 | </para>
|
---|
76 | </listitem>
|
---|
77 | </itemizedlist>
|
---|
78 |
|
---|
79 | <bridgehead renderas="sect3">OpenSSH Dependencies</bridgehead>
|
---|
80 |
|
---|
81 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
82 | <para role="required"><xref linkend="openssl"/></para>
|
---|
83 |
|
---|
84 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
85 | <para role="optional">
|
---|
86 | <xref linkend="linux-pam"/>,
|
---|
87 | <xref linkend="x-window-system"/>,
|
---|
88 | <xref linkend="mitkrb"/>,
|
---|
89 | <ulink url="http://www.thrysoee.dk/editline/">libedit</ulink>
|
---|
90 | (provides a command-line history feature to <command>sftp</command>),
|
---|
91 | <ulink url="http://www.opensc-project.org/">OpenSC</ulink> and
|
---|
92 | <ulink url="http://www.citi.umich.edu/projects/smartcard/sectok.html">libsectok</ulink>
|
---|
93 | </para>
|
---|
94 |
|
---|
95 | <bridgehead renderas="sect4">Optional Runtime (Used only to gather entropy)</bridgehead>
|
---|
96 | <para role="optional">
|
---|
97 | <xref linkend="openjdk"/>,
|
---|
98 | <xref linkend="net-tools"/> and
|
---|
99 | <xref linkend="sysstat"/>.
|
---|
100 | </para>
|
---|
101 |
|
---|
102 | <para condition="html" role="usernotes">
|
---|
103 | User Notes: <ulink url='&blfs-wiki;/OpenSSH'/>
|
---|
104 | </para>
|
---|
105 | </sect2>
|
---|
106 |
|
---|
107 | <sect2 role="installation">
|
---|
108 | <title>Installation of OpenSSH</title>
|
---|
109 |
|
---|
110 | <para>
|
---|
111 | <application>OpenSSH</application> runs as two processes when connecting
|
---|
112 | to other computers. The first process is a privileged process and controls
|
---|
113 | the issuance of privileges as necessary. The second process communicates
|
---|
114 | with the network. Additional installation steps are necessary to set up
|
---|
115 | the proper environment, which are performed by issuing the following
|
---|
116 | commands as the <systemitem class="username">root</systemitem> user:
|
---|
117 | </para>
|
---|
118 |
|
---|
119 | <screen role="root"><userinput>install -v -m700 -d /var/lib/sshd &&
|
---|
120 | chown -v root:sys /var/lib/sshd &&
|
---|
121 | groupadd -g 50 sshd &&
|
---|
122 | useradd -c 'sshd PrivSep' -d /var/lib/sshd -g sshd \
|
---|
123 | -s /bin/false -u 50 sshd</userinput></screen>
|
---|
124 |
|
---|
125 | <para>
|
---|
126 | Install <application>OpenSSH</application> by running the following
|
---|
127 | commands:
|
---|
128 | </para>
|
---|
129 |
|
---|
130 | <screen><userinput>./configure --prefix=/usr \
|
---|
131 | --sysconfdir=/etc/ssh \
|
---|
132 | --datadir=/usr/share/sshd \
|
---|
133 | --with-md5-passwords \
|
---|
134 | --with-privsep-path=/var/lib/sshd &&
|
---|
135 | make</userinput></screen>
|
---|
136 |
|
---|
137 | <para>
|
---|
138 | The testsuite requires an installed copy of <command>scp</command> to
|
---|
139 | complete the multiplexing tests. To run the test suite, first copy the
|
---|
140 | <command>scp</command> program to
|
---|
141 | <filename class="directory">/usr/bin</filename>, making sure that you
|
---|
142 | back up any existing copy first.
|
---|
143 | </para>
|
---|
144 |
|
---|
145 | <para>
|
---|
146 | To run the test suite, issue the following commands:
|
---|
147 | </para>
|
---|
148 |
|
---|
149 | <screen role="root"><userinput>make tests 2>&1 | tee check.log
|
---|
150 | grep FATAL check.log</userinput></screen>
|
---|
151 |
|
---|
152 | <para>
|
---|
153 | If the above command produces no 'FATAL' errors, then proceed with the
|
---|
154 | installation, as the <systemitem class="username">root</systemitem> user:
|
---|
155 | </para>
|
---|
156 |
|
---|
157 | <screen role="root"><userinput>make install &&
|
---|
158 | install -v -m755 -d /usr/share/doc/openssh-&openssh-version; &&
|
---|
159 | install -v -m644 INSTALL LICENCE OVERVIEW README* \
|
---|
160 | /usr/share/doc/openssh-&openssh-version;</userinput></screen>
|
---|
161 | </sect2>
|
---|
162 |
|
---|
163 | <sect2 role="commands">
|
---|
164 | <title>Command Explanations</title>
|
---|
165 |
|
---|
166 | <para>
|
---|
167 | <parameter>--sysconfdir=/etc/ssh</parameter>: This prevents the
|
---|
168 | configuration files from being installed in
|
---|
169 | <filename class="directory">/usr/etc</filename>.
|
---|
170 | </para>
|
---|
171 |
|
---|
172 | <para>
|
---|
173 | <parameter>--datadir=/usr/share/sshd</parameter>: This switch puts the
|
---|
174 | Ssh.bin file (used for SmartCard authentication) in
|
---|
175 | <filename class="directory">/usr/share/sshd</filename>.
|
---|
176 | </para>
|
---|
177 |
|
---|
178 | <para>
|
---|
179 | <parameter>--with-md5-passwords</parameter>: This enables the use of MD5
|
---|
180 | passwords.
|
---|
181 | </para>
|
---|
182 |
|
---|
183 | <para>
|
---|
184 | <parameter>--with-pam</parameter>: This parameter enables
|
---|
185 | <application>Linux-PAM</application> support in the build.
|
---|
186 | </para>
|
---|
187 |
|
---|
188 | <para>
|
---|
189 | <parameter>--with-xauth=/usr/bin/xauth</parameter>: Set the default
|
---|
190 | location for the <command>xauth</command> binary for X authentication.
|
---|
191 | Change the location if <command>xauth</command> will be installed to a
|
---|
192 | different path. This can also be controlled from
|
---|
193 | <filename>sshd_config</filename> with the XAuthLocation keyword. You can
|
---|
194 | omit this switch if <application>Xorg</application> is already installed.
|
---|
195 | </para>
|
---|
196 |
|
---|
197 | <para>
|
---|
198 | <parameter>--with-kerberos5=/usr</parameter>: This option is used to
|
---|
199 | include Kerberos 5 support in the build.
|
---|
200 | </para>
|
---|
201 |
|
---|
202 | </sect2>
|
---|
203 |
|
---|
204 | <sect2 role="configuration">
|
---|
205 | <title>Configuring OpenSSH</title>
|
---|
206 |
|
---|
207 | <sect3 id="openssh-config">
|
---|
208 | <title>Config Files</title>
|
---|
209 |
|
---|
210 | <para>
|
---|
211 | <filename>~/.ssh/*</filename>,
|
---|
212 | <filename>/etc/ssh/ssh_config</filename>, and
|
---|
213 | <filename>/etc/ssh/sshd_config</filename>
|
---|
214 | </para>
|
---|
215 |
|
---|
216 | <indexterm zone="openssh openssh-config">
|
---|
217 | <primary sortas="e-AA.ssh">~/.ssh/*</primary>
|
---|
218 | </indexterm>
|
---|
219 |
|
---|
220 | <indexterm zone="openssh openssh-config">
|
---|
221 | <primary sortas="e-etc-ssh-ssh_config">/etc/ssh/ssh_config</primary>
|
---|
222 | </indexterm>
|
---|
223 |
|
---|
224 | <indexterm zone="openssh openssh-config">
|
---|
225 | <primary sortas="e-etc-ssh-sshd_config">/etc/ssh/sshd_config</primary>
|
---|
226 | </indexterm>
|
---|
227 |
|
---|
228 | <para>
|
---|
229 | There are no required changes to any of these files. However,
|
---|
230 | you may wish to view the
|
---|
231 | <filename class='directory'>/etc/ssh/</filename> files and make any
|
---|
232 | changes appropriate for the security of your system. One recommended
|
---|
233 | change is that you disable
|
---|
234 | <systemitem class='username'>root</systemitem> login via
|
---|
235 | <command>ssh</command>. Execute the following command as the
|
---|
236 | <systemitem class='username'>root</systemitem> user to disable
|
---|
237 | <systemitem class='username'>root</systemitem> login via
|
---|
238 | <command>ssh</command>:
|
---|
239 | </para>
|
---|
240 |
|
---|
241 | <screen role="root"><userinput>echo "PermitRootLogin no" >> /etc/ssh/sshd_config</userinput></screen>
|
---|
242 |
|
---|
243 | <para>
|
---|
244 | If you want to be able to log in without typing in your password, first
|
---|
245 | create ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub with
|
---|
246 | <command>ssh-keygen</command> and then copy ~/.ssh/id_rsa.pub to
|
---|
247 | ~/.ssh/authorized_keys on the remote computer that you want to log into.
|
---|
248 | You'll need to change REMOTE_HOSTNAME for the hostname of the remote
|
---|
249 | computer and you'll also need to enter you password for the ssh command
|
---|
250 | to succeed:
|
---|
251 | </para>
|
---|
252 |
|
---|
253 | <screen><userinput>ssh-keygen &&
|
---|
254 | public_key="$(cat ~/.ssh/id_rsa.pub)" &&
|
---|
255 | ssh REMOTE_HOSTNAME "echo ${public_key} >> ~/.ssh/authorized_keys" &&
|
---|
256 | unset public_key</userinput></screen>
|
---|
257 |
|
---|
258 | <para>
|
---|
259 | Once you've got passwordless logins working it's actually more secure
|
---|
260 | than logging in with a password (as the private key is much longer than
|
---|
261 | most people's passwords). If you would like to now disable password
|
---|
262 | logins, as the <systemitem class="username">root</systemitem> user:
|
---|
263 | </para>
|
---|
264 |
|
---|
265 |
|
---|
266 | <screen role="root"><userinput>echo "PasswordAuthentication no" >> /etc/ssh/sshd_config &&
|
---|
267 | echo "ChallengeResponseAuthentication no" >> /etc/ssh/sshd_config</userinput></screen>
|
---|
268 |
|
---|
269 | <para>
|
---|
270 | If you added <application>LinuxPAM</application> support and you want
|
---|
271 | ssh to use it then you will need to add a configuration file for
|
---|
272 | <application>sshd</application> and enable use of
|
---|
273 | <application>LinuxPAM</application>. Note, ssh only uses PAM to check
|
---|
274 | passwords, if you've disabled password logins these commands are not
|
---|
275 | needed. If you want to use PAM issue the following commands as the
|
---|
276 | <systemitem class='username'>root</systemitem> user:
|
---|
277 | </para>
|
---|
278 |
|
---|
279 | <screen role="root"><userinput>sed 's@d/login@d/sshd@g' /etc/pam.d/login > /etc/pam.d/sshd &&
|
---|
280 | chmod 644 /etc/pam.d/sshd &&
|
---|
281 | echo "USEPAM yes" >> /etc/ssh/sshd_config</userinput></screen>
|
---|
282 |
|
---|
283 | <para>
|
---|
284 | Additional configuration information can be found in the man
|
---|
285 | pages for <command>sshd</command>, <command>ssh</command> and
|
---|
286 | <command>ssh-agent</command>.
|
---|
287 | </para>
|
---|
288 | </sect3>
|
---|
289 |
|
---|
290 | <sect3 id="openssh-init">
|
---|
291 | <title>Boot Script</title>
|
---|
292 |
|
---|
293 | <para>
|
---|
294 | To start the SSH server at system boot, install the
|
---|
295 | <filename>/etc/rc.d/init.d/sshd</filename> init script included
|
---|
296 | in the <xref linkend="bootscripts"/> package.
|
---|
297 | </para>
|
---|
298 |
|
---|
299 | <indexterm zone="openssh openssh-init">
|
---|
300 | <primary sortas="f-sshd">sshd</primary>
|
---|
301 | </indexterm>
|
---|
302 |
|
---|
303 | <screen role="root"><userinput>make install-sshd</userinput></screen>
|
---|
304 | </sect3>
|
---|
305 | </sect2>
|
---|
306 |
|
---|
307 | <sect2 role="content">
|
---|
308 | <title>Contents</title>
|
---|
309 |
|
---|
310 | <segmentedlist>
|
---|
311 | <segtitle>Installed Programs</segtitle>
|
---|
312 | <segtitle>Installed Directories</segtitle>
|
---|
313 |
|
---|
314 | <seglistitem>
|
---|
315 | <seg>
|
---|
316 | scp, sftp, sftp-server, slogin, ssh, sshd, ssh-add, ssh-agent,
|
---|
317 | ssh-keygen, ssh-keyscan and ssh-keysign.
|
---|
318 | </seg>
|
---|
319 | <seg>
|
---|
320 | /etc/ssh,
|
---|
321 | /var/lib/sshd,
|
---|
322 | /usr/lib/openssh and
|
---|
323 | /usr/share/doc/openssh-&openssh-version;.
|
---|
324 | </seg>
|
---|
325 | </seglistitem>
|
---|
326 | </segmentedlist>
|
---|
327 |
|
---|
328 | <variablelist>
|
---|
329 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
330 | <?dbfo list-presentation="list"?>
|
---|
331 | <?dbhtml list-presentation="table"?>
|
---|
332 |
|
---|
333 | <varlistentry id="scp">
|
---|
334 | <term><command>scp</command></term>
|
---|
335 | <listitem>
|
---|
336 | <para>
|
---|
337 | is a file copy program that acts like <command>rcp</command> except
|
---|
338 | it uses an encrypted protocol.
|
---|
339 | </para>
|
---|
340 | <indexterm zone="openssh scp">
|
---|
341 | <primary sortas="b-scp">scp</primary>
|
---|
342 | </indexterm>
|
---|
343 | </listitem>
|
---|
344 | </varlistentry>
|
---|
345 |
|
---|
346 | <varlistentry id="sftp">
|
---|
347 | <term><command>sftp</command></term>
|
---|
348 | <listitem>
|
---|
349 | <para>
|
---|
350 | is an FTP-like program that works over the SSH1 and SSH2 protocols.
|
---|
351 | </para>
|
---|
352 | <indexterm zone="openssh sftp">
|
---|
353 | <primary sortas="b-sftp">sftp</primary>
|
---|
354 | </indexterm>
|
---|
355 | </listitem>
|
---|
356 | </varlistentry>
|
---|
357 |
|
---|
358 | <varlistentry id="sftp-server">
|
---|
359 | <term><command>sftp-server</command></term>
|
---|
360 | <listitem>
|
---|
361 | <para>
|
---|
362 | is an SFTP server subsystem. This program is not normally called
|
---|
363 | directly by the user.
|
---|
364 | </para>
|
---|
365 | <indexterm zone="openssh sftp-server">
|
---|
366 | <primary sortas="b-sftp-server">sftp-server</primary>
|
---|
367 | </indexterm>
|
---|
368 | </listitem>
|
---|
369 | </varlistentry>
|
---|
370 |
|
---|
371 | <varlistentry id="slogin">
|
---|
372 | <term><command>slogin</command></term>
|
---|
373 | <listitem>
|
---|
374 | <para>
|
---|
375 | is a symlink to <command>ssh</command>.
|
---|
376 | </para>
|
---|
377 | <indexterm zone="openssh slogin">
|
---|
378 | <primary sortas="b-slogin">slogin</primary>
|
---|
379 | </indexterm>
|
---|
380 | </listitem>
|
---|
381 | </varlistentry>
|
---|
382 |
|
---|
383 | <varlistentry id="ssh">
|
---|
384 | <term><command>ssh</command></term>
|
---|
385 | <listitem>
|
---|
386 | <para>
|
---|
387 | is an <command>rlogin</command>/<command>rsh</command>-like client
|
---|
388 | program except it uses an encrypted protocol.
|
---|
389 | </para>
|
---|
390 | <indexterm zone="openssh ssh">
|
---|
391 | <primary sortas="b-ssh">ssh</primary>
|
---|
392 | </indexterm>
|
---|
393 | </listitem>
|
---|
394 | </varlistentry>
|
---|
395 |
|
---|
396 | <varlistentry id="sshd">
|
---|
397 | <term><command>sshd</command></term>
|
---|
398 | <listitem>
|
---|
399 | <para>
|
---|
400 | is a daemon that listens for <command>ssh</command> login requests.
|
---|
401 | </para>
|
---|
402 | <indexterm zone="openssh sshd">
|
---|
403 | <primary sortas="b-sshd">sshd</primary>
|
---|
404 | </indexterm>
|
---|
405 | </listitem>
|
---|
406 | </varlistentry>
|
---|
407 |
|
---|
408 | <varlistentry id="ssh-add">
|
---|
409 | <term><command>ssh-add</command></term>
|
---|
410 | <listitem>
|
---|
411 | <para>
|
---|
412 | is a tool which adds keys to the <command>ssh-agent</command>.
|
---|
413 | </para>
|
---|
414 | <indexterm zone="openssh ssh-add">
|
---|
415 | <primary sortas="b-ssh-add">ssh-add</primary>
|
---|
416 | </indexterm>
|
---|
417 | </listitem>
|
---|
418 | </varlistentry>
|
---|
419 |
|
---|
420 | <varlistentry id="ssh-agent">
|
---|
421 | <term><command>ssh-agent</command></term>
|
---|
422 | <listitem>
|
---|
423 | <para>
|
---|
424 | is an authentication agent that can store private keys.
|
---|
425 | </para>
|
---|
426 | <indexterm zone="openssh ssh-agent">
|
---|
427 | <primary sortas="b-ssh-agent">ssh-agent</primary>
|
---|
428 | </indexterm>
|
---|
429 | </listitem>
|
---|
430 | </varlistentry>
|
---|
431 |
|
---|
432 | <varlistentry id="ssh-keygen">
|
---|
433 | <term><command>ssh-keygen</command></term>
|
---|
434 | <listitem>
|
---|
435 | <para>
|
---|
436 | is a key generation tool.
|
---|
437 | </para>
|
---|
438 | <indexterm zone="openssh ssh-keygen">
|
---|
439 | <primary sortas="b-ssh-keygen">ssh-keygen</primary>
|
---|
440 | </indexterm>
|
---|
441 | </listitem>
|
---|
442 | </varlistentry>
|
---|
443 |
|
---|
444 | <varlistentry id="ssh-keyscan">
|
---|
445 | <term><command>ssh-keyscan</command></term>
|
---|
446 | <listitem>
|
---|
447 | <para>
|
---|
448 | is a utility for gathering public host keys from a number of hosts.
|
---|
449 | </para>
|
---|
450 | <indexterm zone="openssh ssh-keyscan">
|
---|
451 | <primary sortas="b-ssh-keyscan">ssh-keyscan</primary>
|
---|
452 | </indexterm>
|
---|
453 | </listitem>
|
---|
454 | </varlistentry>
|
---|
455 |
|
---|
456 | <varlistentry id="ssh-keysign">
|
---|
457 | <term><command>ssh-keysign</command></term>
|
---|
458 | <listitem>
|
---|
459 | <para>
|
---|
460 | is used by <command>ssh</command> to access the local host keys and
|
---|
461 | generate the digital signature required during hostbased
|
---|
462 | authentication with SSH protocol version 2. This program is not
|
---|
463 | normally called directly by the user.
|
---|
464 | </para>
|
---|
465 | <indexterm zone="openssh ssh-keysign">
|
---|
466 | <primary sortas="b-ssh-keysign">ssh-keysign</primary>
|
---|
467 | </indexterm>
|
---|
468 | </listitem>
|
---|
469 | </varlistentry>
|
---|
470 | </variablelist>
|
---|
471 | </sect2>
|
---|
472 | </sect1>
|
---|