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