1d93a896eSDag-Erling Smørgrav1. Prerequisites 283d2307dSDag-Erling Smørgrav---------------- 383d2307dSDag-Erling Smørgrav 4ca86bcf2SDag-Erling SmørgravA C compiler. Any C89 or better compiler should work. Where supported, 5ca86bcf2SDag-Erling Smørgravconfigure will attempt to enable the compiler's run-time integrity checking 6ca86bcf2SDag-Erling Smørgravoptions. Some notes about specific compilers: 7ca86bcf2SDag-Erling Smørgrav - clang: -ftrapv and -sanitize=integer require the compiler-rt runtime 8ca86bcf2SDag-Erling Smørgrav (CC=clang LDFLAGS=--rtlib=compiler-rt ./configure) 9ca86bcf2SDag-Erling Smørgrav 10a0ee8cc6SDag-Erling SmørgravYou will need working installations of Zlib and libcrypto (LibreSSL / 11a0ee8cc6SDag-Erling SmørgravOpenSSL) 1283d2307dSDag-Erling Smørgrav 13ca86bcf2SDag-Erling SmørgravZlib 1.1.4 or 1.2.1.2 or greater (earlier 1.2.x versions have problems): 1483d2307dSDag-Erling Smørgravhttp://www.gzip.org/zlib/ 1583d2307dSDag-Erling Smørgrav 16*47dd1d1bSDag-Erling Smørgravlibcrypto (LibreSSL or OpenSSL >= 1.0.1 < 1.1.0) 17a0ee8cc6SDag-Erling SmørgravLibreSSL http://www.libressl.org/ ; or 18a0ee8cc6SDag-Erling SmørgravOpenSSL http://www.openssl.org/ 1983d2307dSDag-Erling Smørgrav 20a0ee8cc6SDag-Erling SmørgravLibreSSL/OpenSSL should be compiled as a position-independent library 21a0ee8cc6SDag-Erling Smørgrav(i.e. with -fPIC) otherwise OpenSSH will not be able to link with it. 22a0ee8cc6SDag-Erling SmørgravIf you must use a non-position-independent libcrypto, then you may need 23076ad2f8SDag-Erling Smørgravto configure OpenSSH --without-pie. Note that because of API changes, 24076ad2f8SDag-Erling SmørgravOpenSSL 1.1.x is not currently supported. 2583d2307dSDag-Erling Smørgrav 26761efaa7SDag-Erling SmørgravThe remaining items are optional. 27761efaa7SDag-Erling Smørgrav 2883d2307dSDag-Erling SmørgravNB. If you operating system supports /dev/random, you should configure 29a0ee8cc6SDag-Erling Smørgravlibcrypto (LibreSSL/OpenSSL) to use it. OpenSSH relies on libcrypto's 30a0ee8cc6SDag-Erling Smørgravdirect support of /dev/random, or failing that, either prngd or egd 31d4af9e69SDag-Erling Smørgrav 32d4af9e69SDag-Erling SmørgravPRNGD: 33d4af9e69SDag-Erling Smørgrav 34d4af9e69SDag-Erling SmørgravIf your system lacks kernel-based random collection, the use of Lutz 35d4af9e69SDag-Erling SmørgravJaenicke's PRNGd is recommended. 36d4af9e69SDag-Erling Smørgrav 37d4af9e69SDag-Erling Smørgravhttp://prngd.sourceforge.net/ 38d4af9e69SDag-Erling Smørgrav 39d4af9e69SDag-Erling SmørgravEGD: 40d4af9e69SDag-Erling Smørgrav 41a0ee8cc6SDag-Erling SmørgravIf the kernel lacks /dev/random the Entropy Gathering Daemon (EGD) is 42a0ee8cc6SDag-Erling Smørgravsupported only if libcrypto supports it. 43d4af9e69SDag-Erling Smørgrav 44a0ee8cc6SDag-Erling Smørgravhttp://egd.sourceforge.net/ 4583d2307dSDag-Erling Smørgrav 4683d2307dSDag-Erling SmørgravPAM: 47d4af9e69SDag-Erling Smørgrav 48d4af9e69SDag-Erling SmørgravOpenSSH can utilise Pluggable Authentication Modules (PAM) if your 49d4af9e69SDag-Erling Smørgravsystem supports it. PAM is standard most Linux distributions, Solaris, 50d4af9e69SDag-Erling SmørgravHP-UX 11, AIX >= 5.2, FreeBSD and NetBSD. 51d4af9e69SDag-Erling Smørgrav 52d4af9e69SDag-Erling SmørgravInformation about the various PAM implementations are available: 53d4af9e69SDag-Erling Smørgrav 54d4af9e69SDag-Erling SmørgravSolaris PAM: http://www.sun.com/software/solaris/pam/ 55d4af9e69SDag-Erling SmørgravLinux PAM: http://www.kernel.org/pub/linux/libs/pam/ 56d4af9e69SDag-Erling SmørgravOpenPAM: http://www.openpam.org/ 5783d2307dSDag-Erling Smørgrav 5883d2307dSDag-Erling SmørgravIf you wish to build the GNOME passphrase requester, you will need the GNOME 5983d2307dSDag-Erling Smørgravlibraries and headers. 6083d2307dSDag-Erling Smørgrav 6183d2307dSDag-Erling SmørgravGNOME: 6283d2307dSDag-Erling Smørgravhttp://www.gnome.org/ 6383d2307dSDag-Erling Smørgrav 64d74d50a8SDag-Erling SmørgravAlternatively, Jim Knoble <jmknoble@pobox.com> has written an excellent X11 6583d2307dSDag-Erling Smørgravpassphrase requester. This is maintained separately at: 6683d2307dSDag-Erling Smørgrav 67d95e11bfSDag-Erling Smørgravhttp://www.jmknoble.net/software/x11-ssh-askpass/ 6883d2307dSDag-Erling Smørgrav 69d4af9e69SDag-Erling SmørgravTCP Wrappers: 7083d2307dSDag-Erling Smørgrav 71d4af9e69SDag-Erling SmørgravIf you wish to use the TCP wrappers functionality you will need at least 72d4af9e69SDag-Erling Smørgravtcpd.h and libwrap.a, either in the standard include and library paths, 73d4af9e69SDag-Erling Smørgravor in the directory specified by --with-tcp-wrappers. Version 7.6 is 74d4af9e69SDag-Erling Smørgravknown to work. 7583d2307dSDag-Erling Smørgrav 76d4af9e69SDag-Erling Smørgravhttp://ftp.porcupine.org/pub/security/index.html 7783d2307dSDag-Erling Smørgrav 7883d2307dSDag-Erling SmørgravS/Key Libraries: 794518870cSDag-Erling Smørgrav 804518870cSDag-Erling SmørgravIf you wish to use --with-skey then you will need the library below 814518870cSDag-Erling Smørgravinstalled. No other S/Key library is currently known to be supported. 824518870cSDag-Erling Smørgrav 8383d2307dSDag-Erling Smørgravhttp://www.sparc.spb.su/solaris/skey/ 8483d2307dSDag-Erling Smørgrav 855e8dbd04SDag-Erling SmørgravLibEdit: 86761efaa7SDag-Erling Smørgrav 87761efaa7SDag-Erling Smørgravsftp supports command-line editing via NetBSD's libedit. If your platform 88761efaa7SDag-Erling Smørgravhas it available natively you can use that, alternatively you might try 89761efaa7SDag-Erling Smørgravthese multi-platform ports: 904518870cSDag-Erling Smørgrav 915e8dbd04SDag-Erling Smørgravhttp://www.thrysoee.dk/editline/ 925e8dbd04SDag-Erling Smørgravhttp://sourceforge.net/projects/libedit/ 935e8dbd04SDag-Erling Smørgrav 94462c32cbSDag-Erling SmørgravLDNS: 95462c32cbSDag-Erling Smørgrav 96462c32cbSDag-Erling SmørgravLDNS is a DNS BSD-licensed resolver library which supports DNSSEC. 97462c32cbSDag-Erling Smørgrav 98462c32cbSDag-Erling Smørgravhttp://nlnetlabs.nl/projects/ldns/ 99462c32cbSDag-Erling Smørgrav 100761efaa7SDag-Erling SmørgravAutoconf: 101761efaa7SDag-Erling Smørgrav 102761efaa7SDag-Erling SmørgravIf you modify configure.ac or configure doesn't exist (eg if you checked 103*47dd1d1bSDag-Erling Smørgravthe code out of git yourself) then you will need autoconf-2.69 to rebuild 104d4af9e69SDag-Erling Smørgravthe automatically generated files by running "autoreconf". Earlier 105d4af9e69SDag-Erling Smørgravversions may also work but this is not guaranteed. 106761efaa7SDag-Erling Smørgrav 107761efaa7SDag-Erling Smørgravhttp://www.gnu.org/software/autoconf/ 108761efaa7SDag-Erling Smørgrav 109761efaa7SDag-Erling SmørgravBasic Security Module (BSM): 110761efaa7SDag-Erling Smørgrav 1114f52dfbbSDag-Erling SmørgravNative BSM support is known to exist in Solaris from at least 2.5.1, 112761efaa7SDag-Erling SmørgravFreeBSD 6.1 and OS X. Alternatively, you may use the OpenBSM 113761efaa7SDag-Erling Smørgravimplementation (http://www.openbsm.org). 114761efaa7SDag-Erling Smørgrav 115*47dd1d1bSDag-Erling Smørgravmakedepend: 116*47dd1d1bSDag-Erling Smørgrav 117*47dd1d1bSDag-Erling Smørgravhttps://www.x.org/archive/individual/util/ 118*47dd1d1bSDag-Erling Smørgrav 119*47dd1d1bSDag-Erling SmørgravIf you are making significant changes to the code you may need to rebuild 120*47dd1d1bSDag-Erling Smørgravthe dependency (.depend) file using "make depend", which requires the 121*47dd1d1bSDag-Erling Smørgrav"makedepend" tool from the X11 distribution. 122761efaa7SDag-Erling Smørgrav 12383d2307dSDag-Erling Smørgrav2. Building / Installation 12483d2307dSDag-Erling Smørgrav-------------------------- 12583d2307dSDag-Erling Smørgrav 12683d2307dSDag-Erling SmørgravTo install OpenSSH with default options: 12783d2307dSDag-Erling Smørgrav 12883d2307dSDag-Erling Smørgrav./configure 12983d2307dSDag-Erling Smørgravmake 13083d2307dSDag-Erling Smørgravmake install 13183d2307dSDag-Erling Smørgrav 13283d2307dSDag-Erling SmørgravThis will install the OpenSSH binaries in /usr/local/bin, configuration files 13383d2307dSDag-Erling Smørgravin /usr/local/etc, the server in /usr/local/sbin, etc. To specify a different 13483d2307dSDag-Erling Smørgravinstallation prefix, use the --prefix option to configure: 13583d2307dSDag-Erling Smørgrav 13683d2307dSDag-Erling Smørgrav./configure --prefix=/opt 13783d2307dSDag-Erling Smørgravmake 13883d2307dSDag-Erling Smørgravmake install 13983d2307dSDag-Erling Smørgrav 14083d2307dSDag-Erling SmørgravWill install OpenSSH in /opt/{bin,etc,lib,sbin}. You can also override 14183d2307dSDag-Erling Smørgravspecific paths, for example: 14283d2307dSDag-Erling Smørgrav 14383d2307dSDag-Erling Smørgrav./configure --prefix=/opt --sysconfdir=/etc/ssh 14483d2307dSDag-Erling Smørgravmake 14583d2307dSDag-Erling Smørgravmake install 14683d2307dSDag-Erling Smørgrav 14783d2307dSDag-Erling SmørgravThis will install the binaries in /opt/{bin,lib,sbin}, but will place the 14883d2307dSDag-Erling Smørgravconfiguration files in /etc/ssh. 14983d2307dSDag-Erling Smørgrav 1504518870cSDag-Erling SmørgravIf you are using Privilege Separation (which is enabled by default) 1514518870cSDag-Erling Smørgravthen you will also need to create the user, group and directory used by 1524518870cSDag-Erling Smørgravsshd for privilege separation. See README.privsep for details. 1534518870cSDag-Erling Smørgrav 15483d2307dSDag-Erling SmørgravIf you are using PAM, you may need to manually install a PAM control 15583d2307dSDag-Erling Smørgravfile as "/etc/pam.d/sshd" (or wherever your system prefers to keep 15683d2307dSDag-Erling Smørgravthem). Note that the service name used to start PAM is __progname, 15783d2307dSDag-Erling Smørgravwhich is the basename of the path of your sshd (e.g., the service name 15883d2307dSDag-Erling Smørgravfor /usr/sbin/osshd will be osshd). If you have renamed your sshd 15983d2307dSDag-Erling Smørgravexecutable, your PAM configuration may need to be modified. 16083d2307dSDag-Erling Smørgrav 16183d2307dSDag-Erling SmørgravA generic PAM configuration is included as "contrib/sshd.pam.generic", 16283d2307dSDag-Erling Smørgravyou may need to edit it before using it on your system. If you are 16383d2307dSDag-Erling Smørgravusing a recent version of Red Hat Linux, the config file in 16483d2307dSDag-Erling Smørgravcontrib/redhat/sshd.pam should be more useful. Failure to install a 16583d2307dSDag-Erling Smørgravvalid PAM file may result in an inability to use password 16683d2307dSDag-Erling Smørgravauthentication. On HP-UX 11 and Solaris, the standard /etc/pam.conf 16783d2307dSDag-Erling Smørgravconfiguration will work with sshd (sshd will match the other service 16883d2307dSDag-Erling Smørgravname). 16983d2307dSDag-Erling Smørgrav 17083d2307dSDag-Erling SmørgravThere are a few other options to the configure script: 17183d2307dSDag-Erling Smørgrav 172761efaa7SDag-Erling Smørgrav--with-audit=[module] enable additional auditing via the specified module. 173761efaa7SDag-Erling SmørgravCurrently, drivers for "debug" (additional info via syslog) and "bsm" 174761efaa7SDag-Erling Smørgrav(Sun's Basic Security Module) are supported. 175761efaa7SDag-Erling Smørgrav 176d95e11bfSDag-Erling Smørgrav--with-pam enables PAM support. If PAM support is compiled in, it must 177d95e11bfSDag-Erling Smørgravalso be enabled in sshd_config (refer to the UsePAM directive). 17883d2307dSDag-Erling Smørgrav 17983d2307dSDag-Erling Smørgrav--with-prngd-socket=/some/file allows you to enable EGD or PRNGD 18083d2307dSDag-Erling Smørgravsupport and to specify a PRNGd socket. Use this if your Unix lacks 181*47dd1d1bSDag-Erling Smørgrav/dev/random. 18283d2307dSDag-Erling Smørgrav 18383d2307dSDag-Erling Smørgrav--with-prngd-port=portnum allows you to enable EGD or PRNGD support 18483d2307dSDag-Erling Smørgravand to specify a EGD localhost TCP port. Use this if your Unix lacks 185*47dd1d1bSDag-Erling Smørgrav/dev/random. 18683d2307dSDag-Erling Smørgrav 18783d2307dSDag-Erling Smørgrav--with-lastlog=FILE will specify the location of the lastlog file. 18883d2307dSDag-Erling Smørgrav./configure searches a few locations for lastlog, but may not find 18983d2307dSDag-Erling Smørgravit if lastlog is installed in a different place. 19083d2307dSDag-Erling Smørgrav 19183d2307dSDag-Erling Smørgrav--without-lastlog will disable lastlog support entirely. 19283d2307dSDag-Erling Smørgrav 193d95e11bfSDag-Erling Smørgrav--with-osfsia, --without-osfsia will enable or disable OSF1's Security 19483d2307dSDag-Erling SmørgravIntegration Architecture. The default for OSF1 machines is enable. 19583d2307dSDag-Erling Smørgrav 19683d2307dSDag-Erling Smørgrav--with-skey=PATH will enable S/Key one time password support. You will 19783d2307dSDag-Erling Smørgravneed the S/Key libraries and header files installed for this to work. 19883d2307dSDag-Erling Smørgrav 19983d2307dSDag-Erling Smørgrav--with-tcp-wrappers will enable TCP Wrappers (/etc/hosts.allow|deny) 200d4af9e69SDag-Erling Smørgravsupport. 20183d2307dSDag-Erling Smørgrav 20283d2307dSDag-Erling Smørgrav--with-md5-passwords will enable the use of MD5 passwords. Enable this 203efcad6b7SDag-Erling Smørgravif your operating system uses MD5 passwords and the system crypt() does 204efcad6b7SDag-Erling Smørgravnot support them directly (see the crypt(3/3c) man page). If enabled, the 205efcad6b7SDag-Erling Smørgravresulting binary will support both MD5 and traditional crypt passwords. 20683d2307dSDag-Erling Smørgrav 20783d2307dSDag-Erling Smørgrav--with-utmpx enables utmpx support. utmpx support is automatic for 20883d2307dSDag-Erling Smørgravsome platforms. 20983d2307dSDag-Erling Smørgrav 21083d2307dSDag-Erling Smørgrav--without-shadow disables shadow password support. 21183d2307dSDag-Erling Smørgrav 21283d2307dSDag-Erling Smørgrav--with-ipaddr-display forces the use of a numeric IP address in the 21383d2307dSDag-Erling Smørgrav$DISPLAY environment variable. Some broken systems need this. 21483d2307dSDag-Erling Smørgrav 21583d2307dSDag-Erling Smørgrav--with-default-path=PATH allows you to specify a default $PATH for sessions 21683d2307dSDag-Erling Smørgravstarted by sshd. This replaces the standard path entirely. 21783d2307dSDag-Erling Smørgrav 218d4af9e69SDag-Erling Smørgrav--with-pid-dir=PATH specifies the directory in which the sshd.pid file is 21983d2307dSDag-Erling Smørgravcreated. 22083d2307dSDag-Erling Smørgrav 22183d2307dSDag-Erling Smørgrav--with-xauth=PATH specifies the location of the xauth binary 22283d2307dSDag-Erling Smørgrav 223a0ee8cc6SDag-Erling Smørgrav--with-ssl-dir=DIR allows you to specify where your Libre/OpenSSL 224*47dd1d1bSDag-Erling Smørgravlibraries are installed. 22583d2307dSDag-Erling Smørgrav 226a0ee8cc6SDag-Erling Smørgrav--with-ssl-engine enables Libre/OpenSSL's (hardware) ENGINE support 227761efaa7SDag-Erling Smørgrav 22883d2307dSDag-Erling Smørgrav--with-4in6 Check for IPv4 in IPv6 mapped addresses and convert them to 22983d2307dSDag-Erling Smørgravreal (AF_INET) IPv4 addresses. Works around some quirks on Linux. 23083d2307dSDag-Erling Smørgrav 23183d2307dSDag-Erling SmørgravIf you need to pass special options to the compiler or linker, you 23283d2307dSDag-Erling Smørgravcan specify these as environment variables before running ./configure. 23383d2307dSDag-Erling SmørgravFor example: 23483d2307dSDag-Erling Smørgrav 23583d2307dSDag-Erling SmørgravCFLAGS="-O -m486" LDFLAGS="-s" LIBS="-lrubbish" LD="/usr/foo/ld" ./configure 23683d2307dSDag-Erling Smørgrav 23783d2307dSDag-Erling Smørgrav3. Configuration 23883d2307dSDag-Erling Smørgrav---------------- 23983d2307dSDag-Erling Smørgrav 24083d2307dSDag-Erling SmørgravThe runtime configuration files are installed by in ${prefix}/etc or 24183d2307dSDag-Erling Smørgravwhatever you specified as your --sysconfdir (/usr/local/etc by default). 24283d2307dSDag-Erling Smørgrav 24383d2307dSDag-Erling SmørgravThe default configuration should be instantly usable, though you should 24483d2307dSDag-Erling Smørgravreview it to ensure that it matches your security requirements. 24583d2307dSDag-Erling Smørgrav 24683d2307dSDag-Erling SmørgravTo generate a host key, run "make host-key". Alternately you can do so 24783d2307dSDag-Erling Smørgravmanually using the following commands: 24883d2307dSDag-Erling Smørgrav 249ca86bcf2SDag-Erling Smørgrav ssh-keygen -t [type] -f /etc/ssh/ssh_host_key -N "" 250ca86bcf2SDag-Erling Smørgrav 251d93a896eSDag-Erling Smørgravfor each of the types you wish to generate (rsa, dsa or ecdsa) or 252ca86bcf2SDag-Erling Smørgrav 253ca86bcf2SDag-Erling Smørgrav ssh-keygen -A 254ca86bcf2SDag-Erling Smørgrav 255ca86bcf2SDag-Erling Smørgravto generate keys for all supported types. 25683d2307dSDag-Erling Smørgrav 25783d2307dSDag-Erling SmørgravReplacing /etc/ssh with the correct path to the configuration directory. 25883d2307dSDag-Erling Smørgrav(${prefix}/etc or whatever you specified with --sysconfdir during 25983d2307dSDag-Erling Smørgravconfiguration) 26083d2307dSDag-Erling Smørgrav 26183d2307dSDag-Erling SmørgravIf you have configured OpenSSH with EGD support, ensure that EGD is 26283d2307dSDag-Erling Smørgravrunning and has collected some Entropy. 26383d2307dSDag-Erling Smørgrav 26483d2307dSDag-Erling SmørgravFor more information on configuration, please refer to the manual pages 26583d2307dSDag-Erling Smørgravfor sshd, ssh and ssh-agent. 26683d2307dSDag-Erling Smørgrav 2675e8dbd04SDag-Erling Smørgrav4. (Optional) Send survey 2685e8dbd04SDag-Erling Smørgrav------------------------- 2695e8dbd04SDag-Erling Smørgrav 2705e8dbd04SDag-Erling Smørgrav$ make survey 271761efaa7SDag-Erling Smørgrav[check the contents of the file "survey" to ensure there's no information 272761efaa7SDag-Erling Smørgravthat you consider sensitive] 2735e8dbd04SDag-Erling Smørgrav$ make send-survey 2745e8dbd04SDag-Erling Smørgrav 2755e8dbd04SDag-Erling SmørgravThis will send configuration information for the currently configured 2765e8dbd04SDag-Erling Smørgravhost to a survey address. This will help determine which configurations 2775e8dbd04SDag-Erling Smørgravare actually in use, and what valid combinations of configure options 2785e8dbd04SDag-Erling Smørgravexist. The raw data is available only to the OpenSSH developers, however 2795e8dbd04SDag-Erling Smørgravsummary data may be published. 2805e8dbd04SDag-Erling Smørgrav 2815e8dbd04SDag-Erling Smørgrav5. Problems? 28283d2307dSDag-Erling Smørgrav------------ 28383d2307dSDag-Erling Smørgrav 28483d2307dSDag-Erling SmørgravIf you experience problems compiling, installing or running OpenSSH. 28583d2307dSDag-Erling SmørgravPlease refer to the "reporting bugs" section of the webpage at 286ca86bcf2SDag-Erling Smørgravhttps://www.openssh.com/ 287