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