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
8 - clang: -ftrapv and -sanitize=integer require the compiler-rt runtime
9 (CC=clang LDFLAGS=--rtlib=compiler-rt ./configure)
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.
16 The remaining items are optional.
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):
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/)
25 - OpenSSL (https://www.openssl.org) with any of the following versions:
26 - 1.0.x >= 1.0.1 or 1.1.0 >= 1.1.0g or any 1.1.1
28 Note that due to a bug in EVP_CipherInit OpenSSL 1.1 versions prior to
31 LibreSSL/OpenSSL should be compiled as a position-independent library
32 (i.e. -fPIC, eg by configuring OpenSSL as "./config [options] -fPIC"
33 or LibreSSL as "CFLAGS=-fPIC ./configure") otherwise OpenSSH will not
34 be able to link with it. If you must use a non-position-independent
35 libcrypto, then you may need to configure OpenSSH --without-pie.
37 If you build either from source, running the OpenSSL self-test ("make
38 tests") or the LibreSSL equivalent ("make check") and ensuring that all
39 tests pass is strongly recommended.
41 NB. If you operating system supports /dev/random, you should configure
42 libcrypto (LibreSSL/OpenSSL) to use it. OpenSSH relies on libcrypto's
43 direct support of /dev/random, or failing that, either prngd or egd.
47 If your system lacks kernel-based random collection, the use of Lutz
48 Jaenicke's PRNGd is recommended. It requires that libcrypto be configured
51 http://prngd.sourceforge.net/
55 The Entropy Gathering Daemon (EGD) supports the same interface as prngd.
56 It also supported only if libcrypto is configured to support it.
58 http://egd.sourceforge.net/
62 OpenSSH can utilise Pluggable Authentication Modules (PAM) if your
63 system supports it. PAM is standard most Linux distributions, Solaris,
64 HP-UX 11, AIX >= 5.2, FreeBSD, NetBSD and Mac OS X.
66 Information about the various PAM implementations are available:
68 Solaris PAM: http://www.sun.com/software/solaris/pam/
69 Linux PAM: http://www.kernel.org/pub/linux/libs/pam/
70 OpenPAM: http://www.openpam.org/
72 If you wish to build the GNOME passphrase requester, you will need the GNOME
73 libraries and headers.
78 Alternatively, Jim Knoble <jmknoble@pobox.com> has written an excellent X11
79 passphrase requester. This is maintained separately at:
81 http://www.jmknoble.net/software/x11-ssh-askpass/
85 If you wish to use the TCP wrappers functionality you will need at least
86 tcpd.h and libwrap.a, either in the standard include and library paths,
87 or in the directory specified by --with-tcp-wrappers. Version 7.6 is
90 http://ftp.porcupine.org/pub/security/index.html
94 sftp supports command-line editing via NetBSD's libedit. If your platform
95 has it available natively you can use that, alternatively you might try
96 these multi-platform ports:
98 http://www.thrysoee.dk/editline/
99 http://sourceforge.net/projects/libedit/
103 LDNS is a DNS BSD-licensed resolver library which supports DNSSEC.
105 http://nlnetlabs.nl/projects/ldns/
109 If you modify configure.ac or configure doesn't exist (eg if you checked
110 the code out of git yourself) then you will need autoconf-2.69 and
111 automake-1.16.1 to rebuild the automatically generated files by running
112 "autoreconf". Earlier versions may also work but this is not guaranteed.
114 http://www.gnu.org/software/autoconf/
115 http://www.gnu.org/software/automake/
117 Basic Security Module (BSM):
119 Native BSM support is known to exist in Solaris from at least 2.5.1,
120 FreeBSD 6.1 and OS X. Alternatively, you may use the OpenBSM
121 implementation (http://www.openbsm.org).
125 https://www.x.org/archive/individual/util/
127 If you are making significant changes to the code you may need to rebuild
128 the dependency (.depend) file using "make depend", which requires the
129 "makedepend" tool from the X11 distribution.
133 libfido2 allows the use of hardware security keys over USB. libfido2
134 in turn depends on libcbor. libfido2 >= 1.5.0 is strongly recommended.
135 Limited functionality is possible with earlier libfido2 versions.
137 https://github.com/Yubico/libfido2
138 https://github.com/pjk/libcbor
141 2. Building / Installation
142 --------------------------
144 To install OpenSSH with default options:
150 This will install the OpenSSH binaries in /usr/local/bin, configuration files
151 in /usr/local/etc, the server in /usr/local/sbin, etc. To specify a different
152 installation prefix, use the --prefix option to configure:
154 ./configure --prefix=/opt
158 Will install OpenSSH in /opt/{bin,etc,lib,sbin}. You can also override
159 specific paths, for example:
161 ./configure --prefix=/opt --sysconfdir=/etc/ssh
165 This will install the binaries in /opt/{bin,lib,sbin}, but will place the
166 configuration files in /etc/ssh.
168 If you are using PAM, you may need to manually install a PAM control
169 file as "/etc/pam.d/sshd" (or wherever your system prefers to keep
170 them). Note that the service name used to start PAM is __progname,
171 which is the basename of the path of your sshd (e.g., the service name
172 for /usr/sbin/osshd will be osshd). If you have renamed your sshd
173 executable, your PAM configuration may need to be modified.
175 A generic PAM configuration is included as "contrib/sshd.pam.generic",
176 you may need to edit it before using it on your system. If you are
177 using a recent version of Red Hat Linux, the config file in
178 contrib/redhat/sshd.pam should be more useful. Failure to install a
179 valid PAM file may result in an inability to use password
180 authentication. On HP-UX 11 and Solaris, the standard /etc/pam.conf
181 configuration will work with sshd (sshd will match the other service
184 There are a few other options to the configure script:
186 --with-audit=[module] enable additional auditing via the specified module.
187 Currently, drivers for "debug" (additional info via syslog) and "bsm"
188 (Sun's Basic Security Module) are supported.
190 --with-pam enables PAM support. If PAM support is compiled in, it must
191 also be enabled in sshd_config (refer to the UsePAM directive).
193 --with-prngd-socket=/some/file allows you to enable EGD or PRNGD
194 support and to specify a PRNGd socket. Use this if your Unix lacks
197 --with-prngd-port=portnum allows you to enable EGD or PRNGD support
198 and to specify a EGD localhost TCP port. Use this if your Unix lacks
201 --with-lastlog=FILE will specify the location of the lastlog file.
202 ./configure searches a few locations for lastlog, but may not find
203 it if lastlog is installed in a different place.
205 --without-lastlog will disable lastlog support entirely.
207 --with-osfsia, --without-osfsia will enable or disable OSF1's Security
208 Integration Architecture. The default for OSF1 machines is enable.
210 --with-tcp-wrappers will enable TCP Wrappers (/etc/hosts.allow|deny)
213 --with-utmpx enables utmpx support. utmpx support is automatic for
216 --without-shadow disables shadow password support.
218 --with-ipaddr-display forces the use of a numeric IP address in the
219 $DISPLAY environment variable. Some broken systems need this.
221 --with-default-path=PATH allows you to specify a default $PATH for sessions
222 started by sshd. This replaces the standard path entirely.
224 --with-pid-dir=PATH specifies the directory in which the sshd.pid file is
227 --with-xauth=PATH specifies the location of the xauth binary
229 --with-ssl-dir=DIR allows you to specify where your Libre/OpenSSL
230 libraries are installed.
232 --with-ssl-engine enables Libre/OpenSSL's (hardware) ENGINE support
234 --without-openssl builds without using OpenSSL. Only a subset of ciphers
235 and algorithms are supported in this configuration.
237 --without-zlib builds without zlib. This disables the Compression option.
239 --with-4in6 Check for IPv4 in IPv6 mapped addresses and convert them to
240 real (AF_INET) IPv4 addresses. Works around some quirks on Linux.
242 If you need to pass special options to the compiler or linker, you
243 can specify these as environment variables before running ./configure.
246 CC="/usr/foo/cc" CFLAGS="-O" LDFLAGS="-s" LIBS="-lrubbish" ./configure
251 The runtime configuration files are installed by in ${prefix}/etc or
252 whatever you specified as your --sysconfdir (/usr/local/etc by default).
254 The default configuration should be instantly usable, though you should
255 review it to ensure that it matches your security requirements.
257 To generate a host key, run "make host-key". Alternately you can do so
258 manually using the following commands:
260 ssh-keygen -t [type] -f /etc/ssh/ssh_host_key -N ""
262 for each of the types you wish to generate (rsa, dsa or ecdsa) or
266 to generate keys for all supported types.
268 Replacing /etc/ssh with the correct path to the configuration directory.
269 (${prefix}/etc or whatever you specified with --sysconfdir during
272 If you have configured OpenSSH with EGD/prngd support, ensure that EGD or
273 prngd is running and has collected some entropy first.
275 For more information on configuration, please refer to the manual pages
276 for sshd, ssh and ssh-agent.
278 4. (Optional) Send survey
279 -------------------------
282 [check the contents of the file "survey" to ensure there's no information
283 that you consider sensitive]
286 This will send configuration information for the currently configured
287 host to a survey address. This will help determine which configurations
288 are actually in use, and what valid combinations of configure options
289 exist. The raw data is available only to the OpenSSH developers, however
290 summary data may be published.
295 If you experience problems compiling, installing or running OpenSSH,
296 please refer to the "reporting bugs" section of the webpage at
297 https://www.openssh.com/