INSTALL 10 KB

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