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