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