Building and Installing SSH

For most Unix systems, the installation of SSH is pretty straightforward. Simply download the gzipped tar file from one of the FTP mirror sites listed at http://www.ssh.fi/sshprotocols, for instance, ssh-1.2.25.tar.gz. (Note: Typically there’s a new version of SSH released every few months.) In order to compile SSH, you need an ANSI C compiler such as gcc. The simplest way to build this software is to do the following:

# ./configure
# make
# make install

The configure script should recognize your system type, discover important information about your build environment, and—if everything checks out—create a corresponding Makefile. The make program uses this Makefile to build the software. The make install directive installs the SSH components and manual pages in the right places, and generates the initial 1024-bit host key pair (if it doesn’t already exist).

The last thing you’ll have to do is put sshd in an rc file, so it will launch at startup. On Linux, you’ll want to put it in /etc/rc.d/rc.local, with a syntax like this:

# Start SSH
echo "Starting SSH Daemon..."
/usr/local/sbin/sshd;

There are other parameters you can use with sshd, and we’ll look at some of them in Section 8.3.

You’ll also want to enable the port on which you’re running SSH. In our case, we’re going to use the default port of 22, so we’ll have to edit our /etc/services file and add a line like this:

ssh             22/tcp

As of this writing, SSH has been known to compile on at least thirty-six different ...

Get Virtual Private Networks, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.