]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - crypto/openssh/INSTALL
Merge commit '28fbd2825d216dafca4d991ad96d05b312f4f9a3'
[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 http://www.gzip.org/zlib/
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/)
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
27
28 Note that due to a bug in EVP_CipherInit OpenSSL 1.1 versions prior to
29 1.1.0g can't be used.
30
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.
36
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.
40
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.
44
45 PRNGD:
46
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
49 to support it.
50
51 http://prngd.sourceforge.net/
52
53 EGD:
54
55 The Entropy Gathering Daemon (EGD) supports the same interface as prngd.
56 It also supported only if libcrypto is configured to support it.
57
58 http://egd.sourceforge.net/
59
60 PAM:
61
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.
65
66 Information about the various PAM implementations are available:
67
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/
71
72 If you wish to build the GNOME passphrase requester, you will need the GNOME
73 libraries and headers.
74
75 GNOME:
76 http://www.gnome.org/
77
78 Alternatively, Jim Knoble <jmknoble@pobox.com> has written an excellent X11
79 passphrase requester. This is maintained separately at:
80
81 http://www.jmknoble.net/software/x11-ssh-askpass/
82
83 TCP Wrappers:
84
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
88 known to work.
89
90 http://ftp.porcupine.org/pub/security/index.html
91
92 LibEdit:
93
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:
97
98 http://www.thrysoee.dk/editline/
99 http://sourceforge.net/projects/libedit/
100
101 LDNS:
102
103 LDNS is a DNS BSD-licensed resolver library which supports DNSSEC.
104
105 http://nlnetlabs.nl/projects/ldns/
106
107 Autoconf:
108
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.
113
114 http://www.gnu.org/software/autoconf/
115 http://www.gnu.org/software/automake/
116
117 Basic Security Module (BSM):
118
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).
122
123 makedepend:
124
125 https://www.x.org/archive/individual/util/
126
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.
130
131 libfido2:
132
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.
136
137 https://github.com/Yubico/libfido2
138 https://github.com/pjk/libcbor
139
140
141 2. Building / Installation
142 --------------------------
143
144 To install OpenSSH with default options:
145
146 ./configure
147 make
148 make install
149
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:
153
154 ./configure --prefix=/opt
155 make
156 make install
157
158 Will install OpenSSH in /opt/{bin,etc,lib,sbin}. You can also override
159 specific paths, for example:
160
161 ./configure --prefix=/opt --sysconfdir=/etc/ssh
162 make
163 make install
164
165 This will install the binaries in /opt/{bin,lib,sbin}, but will place the
166 configuration files in /etc/ssh.
167
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.
174
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
182 name).
183
184 There are a few other options to the configure script:
185
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.
189
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).
192
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
195 /dev/random.
196
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
199 /dev/random.
200
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.
204
205 --without-lastlog will disable lastlog support entirely.
206
207 --with-osfsia, --without-osfsia will enable or disable OSF1's Security
208 Integration Architecture.  The default for OSF1 machines is enable.
209
210 --with-tcp-wrappers will enable TCP Wrappers (/etc/hosts.allow|deny)
211 support.
212
213 --with-utmpx enables utmpx support. utmpx support is automatic for
214 some platforms.
215
216 --without-shadow disables shadow password support.
217
218 --with-ipaddr-display forces the use of a numeric IP address in the
219 $DISPLAY environment variable. Some broken systems need this.
220
221 --with-default-path=PATH allows you to specify a default $PATH for sessions
222 started by sshd. This replaces the standard path entirely.
223
224 --with-pid-dir=PATH specifies the directory in which the sshd.pid file is
225 created.
226
227 --with-xauth=PATH specifies the location of the xauth binary
228
229 --with-ssl-dir=DIR allows you to specify where your Libre/OpenSSL
230 libraries are installed.
231
232 --with-ssl-engine enables Libre/OpenSSL's (hardware) ENGINE support
233
234 --without-openssl builds without using OpenSSL.  Only a subset of ciphers
235 and algorithms are supported in this configuration.
236
237 --without-zlib builds without zlib.  This disables the Compression option.
238
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.
241
242 If you need to pass special options to the compiler or linker, you
243 can specify these as environment variables before running ./configure.
244 For example:
245
246 CC="/usr/foo/cc" CFLAGS="-O" LDFLAGS="-s" LIBS="-lrubbish" ./configure
247
248 3. Configuration
249 ----------------
250
251 The runtime configuration files are installed by in ${prefix}/etc or
252 whatever you specified as your --sysconfdir (/usr/local/etc by default).
253
254 The default configuration should be instantly usable, though you should
255 review it to ensure that it matches your security requirements.
256
257 To generate a host key, run "make host-key". Alternately you can do so
258 manually using the following commands:
259
260     ssh-keygen -t [type] -f /etc/ssh/ssh_host_key -N ""
261
262 for each of the types you wish to generate (rsa, dsa or ecdsa) or
263
264     ssh-keygen -A
265
266 to generate keys for all supported types.
267
268 Replacing /etc/ssh with the correct path to the configuration directory.
269 (${prefix}/etc or whatever you specified with --sysconfdir during
270 configuration).
271
272 If you have configured OpenSSH with EGD/prngd support, ensure that EGD or
273 prngd is running and has collected some entropy first.
274
275 For more information on configuration, please refer to the manual pages
276 for sshd, ssh and ssh-agent.
277
278 4. (Optional) Send survey
279 -------------------------
280
281 $ make survey
282 [check the contents of the file "survey" to ensure there's no information
283 that you consider sensitive]
284 $ make send-survey
285
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.
291
292 5. Problems?
293 ------------
294
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/