1*7c478bd9Sstevel@tonic-gate1. Prerequisites 2*7c478bd9Sstevel@tonic-gate---------------- 3*7c478bd9Sstevel@tonic-gate 4*7c478bd9Sstevel@tonic-gateYou will need working installations of Zlib and OpenSSL. 5*7c478bd9Sstevel@tonic-gate 6*7c478bd9Sstevel@tonic-gateZlib: 7*7c478bd9Sstevel@tonic-gatehttp://www.freesoftware.com/pub/infozip/zlib/ 8*7c478bd9Sstevel@tonic-gate 9*7c478bd9Sstevel@tonic-gateOpenSSL 0.9.5a or greater: 10*7c478bd9Sstevel@tonic-gatehttp://www.openssl.org/ 11*7c478bd9Sstevel@tonic-gate 12*7c478bd9Sstevel@tonic-gateRPMs of OpenSSL are available at http://violet.ibs.com.au/openssh/files/support 13*7c478bd9Sstevel@tonic-gate 14*7c478bd9Sstevel@tonic-gateOpenSSH can utilise Pluggable Authentication Modules (PAM) if your system 15*7c478bd9Sstevel@tonic-gatesupports it. PAM is standard on Redhat and Debian Linux and on Solaris. 16*7c478bd9Sstevel@tonic-gate 17*7c478bd9Sstevel@tonic-gatePAM: 18*7c478bd9Sstevel@tonic-gatehttp://www.kernel.org/pub/linux/libs/pam/ 19*7c478bd9Sstevel@tonic-gate 20*7c478bd9Sstevel@tonic-gateIf you wish to build the GNOME passphrase requester, you will need the GNOME 21*7c478bd9Sstevel@tonic-gatelibraries and headers. 22*7c478bd9Sstevel@tonic-gate 23*7c478bd9Sstevel@tonic-gateGNOME: 24*7c478bd9Sstevel@tonic-gatehttp://www.gnome.org/ 25*7c478bd9Sstevel@tonic-gate 26*7c478bd9Sstevel@tonic-gateAlternatively, Jim Knoble <jmknoble@pobox.com> has written an excellent X11 27*7c478bd9Sstevel@tonic-gatepassphrase requester. This is maintained separately at: 28*7c478bd9Sstevel@tonic-gate 29*7c478bd9Sstevel@tonic-gatehttp://www.ntrnet.net/~jmknoble/software/x11-ssh-askpass/index.html 30*7c478bd9Sstevel@tonic-gate 31*7c478bd9Sstevel@tonic-gateThe Entropy Gathering Daemon (EGD) is supported if you have a system which 32*7c478bd9Sstevel@tonic-gatelacks /dev/random and don't want to use OpenSSH's internal entropy collection. 33*7c478bd9Sstevel@tonic-gate 34*7c478bd9Sstevel@tonic-gateEGD: 35*7c478bd9Sstevel@tonic-gatehttp://www.lothar.com/tech/crypto/ 36*7c478bd9Sstevel@tonic-gate 37*7c478bd9Sstevel@tonic-gateGNU Make: 38*7c478bd9Sstevel@tonic-gateftp://ftp.gnu.org/gnu/make/ 39*7c478bd9Sstevel@tonic-gate 40*7c478bd9Sstevel@tonic-gateOpenSSH has only been tested with GNU make. It may work with other 41*7c478bd9Sstevel@tonic-gate'make' programs, but you are on your own. 42*7c478bd9Sstevel@tonic-gate 43*7c478bd9Sstevel@tonic-gatepcre (POSIX Regular Expression library): 44*7c478bd9Sstevel@tonic-gateftp://ftp.cus.cam.ac.uk/pub/software/programs/pcre/ 45*7c478bd9Sstevel@tonic-gate 46*7c478bd9Sstevel@tonic-gateMost platforms do not required this. However older 4.3 BSD do not 47*7c478bd9Sstevel@tonic-gatehave a posix regex library. 48*7c478bd9Sstevel@tonic-gate 49*7c478bd9Sstevel@tonic-gate 50*7c478bd9Sstevel@tonic-gate2. Building / Installation 51*7c478bd9Sstevel@tonic-gate-------------------------- 52*7c478bd9Sstevel@tonic-gate 53*7c478bd9Sstevel@tonic-gateTo install OpenSSH with default options: 54*7c478bd9Sstevel@tonic-gate 55*7c478bd9Sstevel@tonic-gate./configure 56*7c478bd9Sstevel@tonic-gatemake 57*7c478bd9Sstevel@tonic-gatemake install 58*7c478bd9Sstevel@tonic-gate 59*7c478bd9Sstevel@tonic-gateThis will install the OpenSSH binaries in /usr/local/bin, configuration files 60*7c478bd9Sstevel@tonic-gatein /usr/local/etc, the server in /usr/local/sbin, etc. To specify a different 61*7c478bd9Sstevel@tonic-gateinstallation prefix, use the --prefix option to configure: 62*7c478bd9Sstevel@tonic-gate 63*7c478bd9Sstevel@tonic-gate./configure --prefix=/opt 64*7c478bd9Sstevel@tonic-gatemake 65*7c478bd9Sstevel@tonic-gatemake install 66*7c478bd9Sstevel@tonic-gate 67*7c478bd9Sstevel@tonic-gateWill install OpenSSH in /opt/{bin,etc,lib,sbin}. You can also override 68*7c478bd9Sstevel@tonic-gatespecific paths, for example: 69*7c478bd9Sstevel@tonic-gate 70*7c478bd9Sstevel@tonic-gate./configure --prefix=/opt --sysconfdir=/etc/ssh 71*7c478bd9Sstevel@tonic-gatemake 72*7c478bd9Sstevel@tonic-gatemake install 73*7c478bd9Sstevel@tonic-gate 74*7c478bd9Sstevel@tonic-gateThis will install the binaries in /opt/{bin,lib,sbin}, but will place the 75*7c478bd9Sstevel@tonic-gateconfiguration files in /etc/ssh. 76*7c478bd9Sstevel@tonic-gate 77*7c478bd9Sstevel@tonic-gateIf you are using PAM, you will need to manually install a PAM 78*7c478bd9Sstevel@tonic-gatecontrol file as "/etc/pam.d/sshd" (or wherever your system 79*7c478bd9Sstevel@tonic-gateprefers to keep them). A generic PAM configuration is included as 80*7c478bd9Sstevel@tonic-gate"contrib/sshd.pam.generic", you may need to edit it before using it on 81*7c478bd9Sstevel@tonic-gateyour system. If you are using a recent version of Redhat Linux, the 82*7c478bd9Sstevel@tonic-gateconfig file in contrib/redhat/sshd.pam should be more useful. 83*7c478bd9Sstevel@tonic-gateFailure to install a valid PAM file may result in an inability to 84*7c478bd9Sstevel@tonic-gateuse password authentication. 85*7c478bd9Sstevel@tonic-gate 86*7c478bd9Sstevel@tonic-gateThere are a few other options to the configure script: 87*7c478bd9Sstevel@tonic-gate 88*7c478bd9Sstevel@tonic-gate--with-rsh=PATH allows you to specify the path to your rsh program. 89*7c478bd9Sstevel@tonic-gateNormally ./configure will search the current $PATH for 'rsh'. You 90*7c478bd9Sstevel@tonic-gatemay need to specify this option if rsh is not in your path or has a 91*7c478bd9Sstevel@tonic-gatedifferent name. 92*7c478bd9Sstevel@tonic-gate 93*7c478bd9Sstevel@tonic-gate--without-pam will disable PAM support. PAM is automatically detected 94*7c478bd9Sstevel@tonic-gateand switched on if found. 95*7c478bd9Sstevel@tonic-gate 96*7c478bd9Sstevel@tonic-gate--enable-gnome-askpass will build the GNOME passphrase dialog. You 97*7c478bd9Sstevel@tonic-gateneed a working installation of GNOME, including the development 98*7c478bd9Sstevel@tonic-gateheaders, for this to work. 99*7c478bd9Sstevel@tonic-gate 100*7c478bd9Sstevel@tonic-gate--with-random=/some/file allows you to specify an alternate source of 101*7c478bd9Sstevel@tonic-gaterandom numbers (the default is /dev/urandom). Unless you are absolutely 102*7c478bd9Sstevel@tonic-gatesure of what you are doing, it is best to leave this alone. 103*7c478bd9Sstevel@tonic-gate 104*7c478bd9Sstevel@tonic-gate--with-egd-pool=/some/file allows you to enable Entropy Gathering 105*7c478bd9Sstevel@tonic-gateDaemon support and to specify a EGD pool socket. Use this if your 106*7c478bd9Sstevel@tonic-gateUnix lacks /dev/random and you don't want to use OpenSSH's builtin 107*7c478bd9Sstevel@tonic-gateentropy collection support. 108*7c478bd9Sstevel@tonic-gate 109*7c478bd9Sstevel@tonic-gate--with-lastlog=FILE will specify the location of the lastlog file. 110*7c478bd9Sstevel@tonic-gate./configure searches a few locations for lastlog, but may not find 111*7c478bd9Sstevel@tonic-gateit if lastlog is installed in a different place. 112*7c478bd9Sstevel@tonic-gate 113*7c478bd9Sstevel@tonic-gate--without-lastlog will disable lastlog support entirely. 114*7c478bd9Sstevel@tonic-gate 115*7c478bd9Sstevel@tonic-gate--with-kerberos4=PATH will enable Kerberos IV support. You will need 116*7c478bd9Sstevel@tonic-gateto have the Kerberos libraries and header files installed for this 117*7c478bd9Sstevel@tonic-gateto work. Use the optional PATH argument to specify the root of your 118*7c478bd9Sstevel@tonic-gateKerberos installation. 119*7c478bd9Sstevel@tonic-gate 120*7c478bd9Sstevel@tonic-gate--with-afs=PATH will enable AFS support. You will need to have the 121*7c478bd9Sstevel@tonic-gateKerberos IV and the AFS libraries and header files installed for this 122*7c478bd9Sstevel@tonic-gateto work. Use the optional PATH argument to specify the root of your 123*7c478bd9Sstevel@tonic-gateAFS installation. AFS requires Kerberos support to be enabled. 124*7c478bd9Sstevel@tonic-gate 125*7c478bd9Sstevel@tonic-gate--with-skey will enable S/Key one time password support. You will need 126*7c478bd9Sstevel@tonic-gatethe S/Key libraries and header files installed for this to work. 127*7c478bd9Sstevel@tonic-gate 128*7c478bd9Sstevel@tonic-gate--with-tcp-wrappers will enable TCP Wrappers (/etc/hosts.allow|deny) 129*7c478bd9Sstevel@tonic-gatesupport. You will need libwrap.a and tcpd.h installed. 130*7c478bd9Sstevel@tonic-gate 131*7c478bd9Sstevel@tonic-gate--with-md5-passwords will enable the use of MD5 passwords. Enable this 132*7c478bd9Sstevel@tonic-gateif your operating system uses MD5 passwords without using PAM. 133*7c478bd9Sstevel@tonic-gate 134*7c478bd9Sstevel@tonic-gate--with-utmpx enables utmpx support. utmpx support is automatic for 135*7c478bd9Sstevel@tonic-gatesome platforms. 136*7c478bd9Sstevel@tonic-gate 137*7c478bd9Sstevel@tonic-gate--without-shadow disables shadow password support. 138*7c478bd9Sstevel@tonic-gate 139*7c478bd9Sstevel@tonic-gate--with-ipaddr-display forces the use of a numeric IP address in the 140*7c478bd9Sstevel@tonic-gate$DISPLAY environment variable. Some broken systems need this. 141*7c478bd9Sstevel@tonic-gate 142*7c478bd9Sstevel@tonic-gate--with-default-path=PATH allows you to specify a default $PATH for sessions 143*7c478bd9Sstevel@tonic-gatestarted by sshd. This replaces the standard path entirely. 144*7c478bd9Sstevel@tonic-gate 145*7c478bd9Sstevel@tonic-gate--with-pid-dir=PATH specifies the directory in which the ssh.pid file is 146*7c478bd9Sstevel@tonic-gatecreated. 147*7c478bd9Sstevel@tonic-gate 148*7c478bd9Sstevel@tonic-gate--with-xauth=PATH specifies the location of the xauth binary 149*7c478bd9Sstevel@tonic-gate 150*7c478bd9Sstevel@tonic-gate--with-ipv4-default instructs OpenSSH to use IPv4 by default for new 151*7c478bd9Sstevel@tonic-gateconnections. Normally OpenSSH will try attempt to lookup both IPv6 and 152*7c478bd9Sstevel@tonic-gateIPv4 addresses. On Linux/glibc-2.1.2 this causes long delays in name 153*7c478bd9Sstevel@tonic-gateresolution. If this option is specified, you can still attempt to 154*7c478bd9Sstevel@tonic-gateconnect to IPv6 addresses using the command line option '-6'. 155*7c478bd9Sstevel@tonic-gate 156*7c478bd9Sstevel@tonic-gate--with-ssl-dir=DIR allows you to specify where your OpenSSL libraries 157*7c478bd9Sstevel@tonic-gateare installed. 158*7c478bd9Sstevel@tonic-gate 159*7c478bd9Sstevel@tonic-gate--with-4in6 Check for IPv4 in IPv6 mapped addresses and convert them to 160*7c478bd9Sstevel@tonic-gatereal (AF_INET) IPv4 addresses. Works around some quirks on Linux. 161*7c478bd9Sstevel@tonic-gate 162*7c478bd9Sstevel@tonic-gateIf you need to pass special options to the compiler or linker, you 163*7c478bd9Sstevel@tonic-gatecan specify these as environment variables before running ./configure. 164*7c478bd9Sstevel@tonic-gateFor example: 165*7c478bd9Sstevel@tonic-gate 166*7c478bd9Sstevel@tonic-gateCFLAGS="-O -m486" LDFLAGS="-s" LIBS="-lrubbish" LD="/usr/foo/ld" ./configure 167*7c478bd9Sstevel@tonic-gate 168*7c478bd9Sstevel@tonic-gate3. Configuration 169*7c478bd9Sstevel@tonic-gate---------------- 170*7c478bd9Sstevel@tonic-gate 171*7c478bd9Sstevel@tonic-gateThe runtime configuration files are installed by in ${prefix}/etc or 172*7c478bd9Sstevel@tonic-gatewhatever you specified as your --sysconfdir (/usr/local/etc by default). 173*7c478bd9Sstevel@tonic-gate 174*7c478bd9Sstevel@tonic-gateThe default configuration should be instantly usable, though you should 175*7c478bd9Sstevel@tonic-gatereview it to ensure that it matches your security requirements. 176*7c478bd9Sstevel@tonic-gate 177*7c478bd9Sstevel@tonic-gateTo generate a host key, run "make host-key". Alternately you can do so 178*7c478bd9Sstevel@tonic-gatemanually using the following commands: 179*7c478bd9Sstevel@tonic-gate 180*7c478bd9Sstevel@tonic-gate ssh-keygen -b 1024 -f /etc/ssh/ssh_host_key -N "" 181*7c478bd9Sstevel@tonic-gate ssh-keygen -d -f /etc/ssh/ssh_host_dsa_key -N "" 182*7c478bd9Sstevel@tonic-gate 183*7c478bd9Sstevel@tonic-gateReplacing /etc/ssh with the correct path to the configuration directory. 184*7c478bd9Sstevel@tonic-gate(${prefix}/etc or whatever you specified with --sysconfdir during 185*7c478bd9Sstevel@tonic-gateconfiguration) 186*7c478bd9Sstevel@tonic-gate 187*7c478bd9Sstevel@tonic-gateIf you have configured OpenSSH with EGD support, ensure that EGD is 188*7c478bd9Sstevel@tonic-gaterunning and has collected some Entropy. 189*7c478bd9Sstevel@tonic-gate 190*7c478bd9Sstevel@tonic-gateFor more information on configuration, please refer to the manual pages 191*7c478bd9Sstevel@tonic-gatefor sshd, ssh and ssh-agent. 192*7c478bd9Sstevel@tonic-gate 193*7c478bd9Sstevel@tonic-gate4. Problems? 194*7c478bd9Sstevel@tonic-gate------------ 195*7c478bd9Sstevel@tonic-gate 196*7c478bd9Sstevel@tonic-gateIf you experience problems compiling, installing or running OpenSSH. 197*7c478bd9Sstevel@tonic-gatePlease refer to the "reporting bugs" section of the webpage at 198*7c478bd9Sstevel@tonic-gatehttp://www.openssh.com/ 199*7c478bd9Sstevel@tonic-gate 200