source: postlfs/security/openssh.xml@ 01caba44

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 01caba44 was ce4cc4c, checked in by Bruce Dubbs <bdubbs@…>, 13 years ago

Update to wget-1.13

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@8903 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 15.7 KB
RevLine 
[0931098]1<?xml version="1.0" encoding="ISO-8859-1"?>
[6732c094]2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
[0931098]4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
[56586e76]7 <!ENTITY openssh-download-http "http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-&openssh-version;.tar.gz">
[3a3b19b]8 <!ENTITY openssh-download-ftp "ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-&openssh-version;.tar.gz">
[6b5cc24]9 <!ENTITY openssh-md5sum "afe17eee7e98d3b8550cc349834a85d0">
[971bae0d]10 <!ENTITY openssh-size "1.1 MB">
[6b5cc24]11 <!ENTITY openssh-buildsize "44 MB">
12 <!ENTITY openssh-time "3.5 SBU (including the test suite)">
[0931098]13]>
14
[1708d1e9]15<sect1 id="openssh" xreflabel="OpenSSH-&openssh-version;">
[e4e0d060]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
[6b5cc24]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
[e4e0d060]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>
[a6ac43b]66 <para role="required"><xref linkend="openssl"/></para>
[e4e0d060]67
68 <bridgehead renderas="sect4">Optional</bridgehead>
[a6ac43b]69 <para role="optional"><xref linkend="linux-pam"/>,
[e4e0d060]70 <xref linkend="tcpwrappers"/>,
[e77976f]71 <xref linkend="x-window-system"/>,
[e4e0d060]72 <xref linkend="mitkrb"/> or <xref linkend="heimdal"/>,
[3e6f331]73 <ulink url="http://www.thrysoee.dk/editline/">libedit</ulink>
74 (provides a command-line history feature to <command>sftp</command>),
[608a225]75 <ulink url="http://www.opensc-project.org/">OpenSC</ulink>, and
[9561d7e]76 <ulink
77 url="http://www.citi.umich.edu/projects/smartcard/sectok.html">libsectok</ulink></para>
78
[409e2e7]79 <bridgehead renderas="sect4">Optional Runtime (Used only to gather entropy)</bridgehead>
[b66ece35]80 <para role="optional"><xref linkend="icedtea6"/> or <xref linkend="jdk"/>,
[409e2e7]81 <xref linkend="net-tools"/>, and
82 <xref linkend="sysstat"/>.</para>
83
[1663c2b5]84 <para condition="html" role="usernotes">User Notes:
85 <ulink url='&blfs-wiki;/OpenSSH'/></para>
[e4e0d060]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
[3de6059]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>
[e4e0d060]99
[45f3870]100<screen role="root"><userinput>install -v -m700 -d /var/lib/sshd &amp;&amp;
101chown -v root:sys /var/lib/sshd &amp;&amp;
[b21c661]102groupadd -g 50 sshd &amp;&amp;
103useradd -c 'sshd PrivSep' -d /var/lib/sshd -g sshd \
104 -s /bin/false -u 50 sshd</userinput></screen>
[0931098]105
[e4e0d060]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
[409e2e7]109 fail to start up. An alternative is to link against the static
[e4e0d060]110 <application>OpenSSL</application> library. To link against the static
111 library, execute the following command:</para>
[0931098]112
[6c24da75]113<screen><userinput>sed -i 's@-lcrypto@/usr/lib/libcrypto.a -ldl@' configure</userinput></screen>
[0931098]114
[e4e0d060]115 <para>Install <application>OpenSSH</application> by running
116 the following commands:</para>
[0931098]117
[ce4cc4c]118<screen><userinput>sed -i.bak '/K5LIBS=/s/ -ldes//' configure &amp;&amp;
[d52512f2]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 &amp;&amp;
[3a3b19b]125make</userinput></screen>
[1b83a7c1]126
[e4e0d060]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
[7c9e252]131 test suite will fail. Additionally, the testsuite requires an installed
[409e2e7]132 copy of <command>scp</command> to complete the multiplexing tests. To
[a41f643]133 run the test suite, first copy the scp program to
134 <filename class="directory">/usr/bin</filename>, making sure that you
[409e2e7]135 back up any existing copy first.</para>
136
[8c9e2f6e]137 <para>To run the test suite, issue the following commands:</para>
[7c9e252]138
[409e2e7]139<screen role="root"><userinput>make tests 2&gt;&amp;1 | tee check.log
140grep FATAL check.log</userinput></screen>
[7c9e252]141
142 <para>If the above command produces no 'FATAL' errors, then proceed
[409e2e7]143 with the installation, as the
[7c9e252]144 <systemitem class="username">root</systemitem> user:</para>
145
[409e2e7]146<screen role="root"><userinput>make install &amp;&amp;
[45f3870]147install -v -m755 -d /usr/share/doc/openssh-&openssh-version; &amp;&amp;
[6b5cc24]148install -v -m644 INSTALL LICENCE OVERVIEW README* \
[45f3870]149 /usr/share/doc/openssh-&openssh-version;</userinput></screen>
[e4e0d060]150
151 </sect2>
152
153 <sect2 role="commands">
154 <title>Command Explanations</title>
155
[ce4cc4c]156 <para><command>sed -i.bak '/K5LIBS=/s/ -ldes//' configure</command>:
[d52512f2]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
[e4e0d060]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>
[f45b1953]165
[6c24da75]166 <para><parameter>--datadir=/usr/share/sshd</parameter>: This switch
[410e228b]167 puts the Ssh.bin file (used for SmartCard authentication) in
[6c24da75]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>
[e4e0d060]172
[1b744785]173 <para><parameter>--libexecdir=/usr/lib/openssh</parameter>: This parameter
[e4e0d060]174 changes the installation path of some programs to
[1b744785]175 <filename class="directory">/usr/lib/openssh</filename> instead of
[e4e0d060]176 <filename class="directory">/usr/libexec</filename>.</para>
177
[ba7a0ce]178 <para><parameter>--with-pam</parameter>: This parameter enables
179 <application>Linux-PAM</application> support in the build.</para>
180
[4ea98296]181 <para><parameter>--with-xauth=/usr/bin/xauth</parameter>: Set the
[410e228b]182 default location for the <command>xauth</command> binary for X
[4ea98296]183 authentication. Change the location if <command>xauth</command> will
[410e228b]184 be installed to a different path. This can also be controlled from
[4ea98296]185 <filename>sshd_config</filename> with the XAuthLocation keyword.
[618b9a7]186 You can omit this switch if <application>Xorg</application> is already
[4ea98296]187 installed.
188 </para>
189
[a41f643]190 <para><parameter>--with-kerberos5=/usr</parameter>: This option is used to
[409e2e7]191 include Heimdal support in the build.</para>
192
[e4e0d060]193 </sect2>
194
195 <sect2 role="configuration">
196 <title>Configuring OpenSSH</title>
197
[6b5cc24]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
[e4e0d060]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>
[823b1a3]223 files and make any changes appropriate for the security of your system.
[bfb7882]224 One recommended change is that you disable
[823b1a3]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
[e4e0d060]229 <command>ssh</command>:</para>
230
[6c24da75]231<screen role="root"><userinput>echo "PermitRootLogin no" &gt;&gt; /etc/ssh/sshd_config</userinput></screen>
232
233 <para>If you added <application>LinuxPAM</application> support, then you
[410e228b]234 will need to add a configuration file for
[b30ddee]235 <application>sshd</application> and enable use of
236 <application>LinuxPAM</application>. Issue the following commands as the
[6c24da75]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 &gt; /etc/pam.d/sshd &amp;&amp;
[b30ddee]240chmod 644 /etc/pam.d/sshd &amp;&amp;
241echo "USEPAM yes" &gt;&gt; /etc/ssh/sshd_config</userinput></screen>
[e4e0d060]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
[5254d12]254 in the <xref linkend="bootscripts"/> package.</para>
[e4e0d060]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>
[409e2e7]278 <seg>/etc/ssh, /var/lib/sshd, /usr/lib/openssh, and
[45f3870]279 /usr/share/doc/openssh-&openssh-version;</seg>
[e4e0d060]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>
[0c6194bb]313 <para>is an SFTP server subsystem. This program is not normally
314 called directly by the user.</para>
[e4e0d060]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
[0c6194bb]400 authentication with SSH protocol version 2. This program is not normally
401 called directly by the user.</para>
[e4e0d060]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>
Note: See TracBrowser for help on using the repository browser.