]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - crypto/openssh/INSTALL
ssh: Update to OpenSSH 9.4p1
[FreeBSD/FreeBSD.git] / crypto / openssh / INSTALL
1 1. Prerequisites
2 ----------------
3
4 A C compiler.  Any C89 or better compiler that supports variadic macros
5 should work.  Where supported, configure will attempt to enable the
6 compiler's run-time integrity checking options.  Some notes about
7 specific compilers:
8  - clang: -ftrapv and -sanitize=integer require the compiler-rt runtime
9   (CC=clang LDFLAGS=--rtlib=compiler-rt ./configure)
10
11 To support Privilege Separation (which is now required) you will need
12 to create the user, group and directory used by sshd for privilege
13 separation.  See README.privsep for details.
14
15
16 The remaining items are optional.
17
18 A working installation of zlib:
19 Zlib 1.1.4 or 1.2.1.2 or greater (earlier 1.2.x versions have problems):
20 https://zlib.net/
21
22 libcrypto from either of LibreSSL or OpenSSL.  Building without libcrypto
23 is supported but severely restricts the available ciphers and algorithms.
24  - LibreSSL (https://www.libressl.org/) 3.1.0 or greater
25  - OpenSSL (https://www.openssl.org) 1.1.1 or greater
26
27 LibreSSL/OpenSSL should be compiled as a position-independent library
28 (i.e. -fPIC, eg by configuring OpenSSL as "./config [options] -fPIC"
29 or LibreSSL as "CFLAGS=-fPIC ./configure") otherwise OpenSSH will not
30 be able to link with it.  If you must use a non-position-independent
31 libcrypto, then you may need to configure OpenSSH --without-pie.
32
33 If you build either from source, running the OpenSSL self-test ("make
34 tests") or the LibreSSL equivalent ("make check") and ensuring that all
35 tests pass is strongly recommended.
36
37 NB. If you operating system supports /dev/random, you should configure
38 libcrypto (LibreSSL/OpenSSL) to use it. OpenSSH relies on libcrypto's
39 direct support of /dev/random, or failing that, either prngd or egd.
40
41 PRNGD:
42
43 If your system lacks kernel-based random collection, the use of Lutz
44 Jaenicke's PRNGd is recommended. It requires that libcrypto be configured
45 to support it.
46
47 http://prngd.sourceforge.net/
48
49 EGD:
50
51 The Entropy Gathering Daemon (EGD) supports the same interface as prngd.
52 It also supported only if libcrypto is configured to support it.
53
54 http://egd.sourceforge.net/
55
56 PAM:
57
58 OpenSSH can utilise Pluggable Authentication Modules (PAM) if your
59 system supports it. PAM is standard most Linux distributions, Solaris,
60 HP-UX 11, AIX >= 5.2, FreeBSD, NetBSD and Mac OS X.
61
62 Information about the various PAM implementations are available:
63
64 Solaris PAM:    http://www.sun.com/software/solaris/pam/
65 Linux PAM:      http://www.kernel.org/pub/linux/libs/pam/
66 OpenPAM:        http://www.openpam.org/
67
68 If you wish to build the GNOME passphrase requester, you will need the GNOME
69 libraries and headers.
70
71 GNOME:
72 http://www.gnome.org/
73
74 Alternatively, Jim Knoble <jmknoble@pobox.com> has written an excellent X11
75 passphrase requester. This is maintained separately at:
76
77 http://www.jmknoble.net/software/x11-ssh-askpass/
78
79 TCP Wrappers:
80
81 If you wish to use the TCP wrappers functionality you will need at least
82 tcpd.h and libwrap.a, either in the standard include and library paths,
83 or in the directory specified by --with-tcp-wrappers.  Version 7.6 is
84 known to work.
85
86 http://ftp.porcupine.org/pub/security/index.html
87
88 LibEdit:
89
90 sftp supports command-line editing via NetBSD's libedit.  If your platform
91 has it available natively you can use that, alternatively you might try
92 these multi-platform ports:
93
94 http://www.thrysoee.dk/editline/
95 http://sourceforge.net/projects/libedit/
96
97 LDNS:
98
99 LDNS is a DNS BSD-licensed resolver library which supports DNSSEC.
100
101 http://nlnetlabs.nl/projects/ldns/
102
103 Autoconf:
104
105 If you modify configure.ac or configure doesn't exist (eg if you checked
106 the code out of git yourself) then you will need autoconf-2.69 and
107 automake-1.16.1 to rebuild the automatically generated files by running
108 "autoreconf".  Earlier versions may also work but this is not guaranteed.
109
110 http://www.gnu.org/software/autoconf/
111 http://www.gnu.org/software/automake/
112
113 Basic Security Module (BSM):
114
115 Native BSM support is known to exist in Solaris from at least 2.5.1,
116 FreeBSD 6.1 and OS X.  Alternatively, you may use the OpenBSM
117 implementation (http://www.openbsm.org).
118
119 makedepend:
120
121 https://www.x.org/archive/individual/util/
122
123 If you are making significant changes to the code you may need to rebuild
124 the dependency (.depend) file using "make depend", which requires the
125 "makedepend" tool from the X11 distribution.
126
127 libfido2:
128
129 libfido2 allows the use of hardware security keys over USB.  libfido2
130 in turn depends on libcbor.  libfido2 >= 1.5.0 is strongly recommended.
131 Limited functionality is possible with earlier libfido2 versions.
132
133 https://github.com/Yubico/libfido2
134 https://github.com/pjk/libcbor
135
136
137 2. Building / Installation
138 --------------------------
139
140 To install OpenSSH with default options:
141
142 ./configure
143 make
144 make install
145
146 This will install the OpenSSH binaries in /usr/local/bin, configuration files
147 in /usr/local/etc, the server in /usr/local/sbin, etc. To specify a different
148 installation prefix, use the --prefix option to configure:
149
150 ./configure --prefix=/opt
151 make
152 make install
153
154 Will install OpenSSH in /opt/{bin,etc,lib,sbin}. You can also override
155 specific paths, for example:
156
157 ./configure --prefix=/opt --sysconfdir=/etc/ssh
158 make
159 make install
160
161 This will install the binaries in /opt/{bin,lib,sbin}, but will place the
162 configuration files in /etc/ssh.
163
164 If you are using PAM, you may need to manually install a PAM control
165 file as "/etc/pam.d/sshd" (or wherever your system prefers to keep
166 them).  Note that the service name used to start PAM is __progname,
167 which is the basename of the path of your sshd (e.g., the service name
168 for /usr/sbin/osshd will be osshd).  If you have renamed your sshd
169 executable, your PAM configuration may need to be modified.
170
171 A generic PAM configuration is included as "contrib/sshd.pam.generic",
172 you may need to edit it before using it on your system. If you are
173 using a recent version of Red Hat Linux, the config file in
174 contrib/redhat/sshd.pam should be more useful.  Failure to install a
175 valid PAM file may result in an inability to use password
176 authentication.  On HP-UX 11 and Solaris, the standard /etc/pam.conf
177 configuration will work with sshd (sshd will match the other service
178 name).
179
180 There are a few other options to the configure script:
181
182 --with-audit=[module] enable additional auditing via the specified module.
183 Currently, drivers for "debug" (additional info via syslog) and "bsm"
184 (Sun's Basic Security Module) are supported.
185
186 --with-pam enables PAM support. If PAM support is compiled in, it must
187 also be enabled in sshd_config (refer to the UsePAM directive).
188
189 --with-prngd-socket=/some/file allows you to enable EGD or PRNGD
190 support and to specify a PRNGd socket. Use this if your Unix lacks
191 /dev/random.
192
193 --with-prngd-port=portnum allows you to enable EGD or PRNGD support
194 and to specify a EGD localhost TCP port. Use this if your Unix lacks
195 /dev/random.
196
197 --with-lastlog=FILE will specify the location of the lastlog file.
198 ./configure searches a few locations for lastlog, but may not find
199 it if lastlog is installed in a different place.
200
201 --without-lastlog will disable lastlog support entirely.
202
203 --with-osfsia, --without-osfsia will enable or disable OSF1's Security
204 Integration Architecture.  The default for OSF1 machines is enable.
205
206 --with-tcp-wrappers will enable TCP Wrappers (/etc/hosts.allow|deny)
207 support.
208
209 --with-utmpx enables utmpx support. utmpx support is automatic for
210 some platforms.
211
212 --without-shadow disables shadow password support.
213
214 --with-ipaddr-display forces the use of a numeric IP address in the
215 $DISPLAY environment variable. Some broken systems need this.
216
217 --with-default-path=PATH allows you to specify a default $PATH for sessions
218 started by sshd. This replaces the standard path entirely.
219
220 --with-pid-dir=PATH specifies the directory in which the sshd.pid file is
221 created.
222
223 --with-xauth=PATH specifies the location of the xauth binary
224
225 --with-ssl-dir=DIR allows you to specify where your Libre/OpenSSL
226 libraries are installed.
227
228 --with-ssl-engine enables Libre/OpenSSL's (hardware) ENGINE support
229
230 --without-openssl builds without using OpenSSL.  Only a subset of ciphers
231 and algorithms are supported in this configuration.
232
233 --without-zlib builds without zlib.  This disables the Compression option.
234
235 --with-4in6 Check for IPv4 in IPv6 mapped addresses and convert them to
236 real (AF_INET) IPv4 addresses. Works around some quirks on Linux.
237
238 If you need to pass special options to the compiler or linker, you
239 can specify these as environment variables before running ./configure.
240 For example:
241
242 CC="/usr/foo/cc" CFLAGS="-O" LDFLAGS="-s" LIBS="-lrubbish" ./configure
243
244 3. Configuration
245 ----------------
246
247 The runtime configuration files are installed by in ${prefix}/etc or
248 whatever you specified as your --sysconfdir (/usr/local/etc by default).
249
250 The default configuration should be instantly usable, though you should
251 review it to ensure that it matches your security requirements.
252
253 To generate a host key, run "make host-key". Alternately you can do so
254 manually using the following commands:
255
256     ssh-keygen -t [type] -f /etc/ssh/ssh_host_key -N ""
257
258 for each of the types you wish to generate (rsa, dsa or ecdsa) or
259
260     ssh-keygen -A
261
262 to generate keys for all supported types.
263
264 Replacing /etc/ssh with the correct path to the configuration directory.
265 (${prefix}/etc or whatever you specified with --sysconfdir during
266 configuration).
267
268 If you have configured OpenSSH with EGD/prngd support, ensure that EGD or
269 prngd is running and has collected some entropy first.
270
271 For more information on configuration, please refer to the manual pages
272 for sshd, ssh and ssh-agent.
273
274 4. (Optional) Send survey
275 -------------------------
276
277 $ make survey
278 [check the contents of the file "survey" to ensure there's no information
279 that you consider sensitive]
280 $ make send-survey
281
282 This will send configuration information for the currently configured
283 host to a survey address.  This will help determine which configurations
284 are actually in use, and what valid combinations of configure options
285 exist.  The raw data is available only to the OpenSSH developers, however
286 summary data may be published.
287
288 5. Problems?
289 ------------
290
291 If you experience problems compiling, installing or running OpenSSH,
292 please refer to the "reporting bugs" section of the webpage at
293 https://www.openssh.com/