OpenSSH

- This document covers the compilation, installation and basic configuration of the OpenSSH sshd server and the associated SSH client. More advanced configuration is covered in many books and online documents. A good place to start is the OpenSSH website.
- If you install this software it is highly recommended that you keep up-to-date with security advisories published on the OpenSSH website.
- I cannot be held responsible for the security of your SSH server. It is up to you to understand the software you are running. The setup detailed here is enough to get the server and client up and running, nothing more.
- If you spot any major errors on this page, please e-mail me using the link above.
- It is assumed that this installation takes place on a computer on which Core Linux has been successfully installed.
- No software other than the packages bundled with Core Linux have been installed.
- As described in the installation guide, it is assumed that any downloaded application source code is stored in a directory called
/appson the CD-R. - It is assumed that the Core Linux computer is attached to a network on which there is at least one other machine with internet access and a CD burner. It must also be running an SSH client program, such as
sshon *nix or puTTY on Windows.
Preparation
- Download the OpenSSH source code from www.openssh.org.
- Download the OpenSSL source code from www.openssl.org.
- Download the zlib source code from www.gzip.org/zlib.
- Burn the downloaded files to a CD. This page assumes that the subdirectory
/appsis used for the.tar.gzfiles. The CD-ROM can be a multi-session disk.
Booting
- Boot your Core Linux PC.
- Login as
root. You will need to enter the password at the prompt.
Copy the sources
- Place the CD-R in the CD-ROM drive. Mount the CD-ROM drive under
/mnt/cdrom. - Change to the
/appsdirectory on the CD-R. - Copy the all the
.tar.gzfiles to the directory/usr/src. - Change to the
/usr/srcdirectory.
- It is important to install the downloaded programs in the order given here, to ensure that the dependencies are satisfied. Details of the package dependencies for the programs needed to run OpenSSH can be seen here.
Configuring, compiling and installing OpenSSL
- Change to the
/usr/srcdirectory. - Extract the source code from the
.tar.gzfile. - Change to the
/usr/src/openssl-0.9.6gdirectory. - Run the
./configscript. - Run the
makeprogram. - Run the
makeprogram with the argumenttest. - Run the
makeprogram with the argumentinstall.
Configuring, compiling and installing zlib
- Change to the
/usr/srcdirectory. - Extract the source code from the
.tar.gzfile. - Change to the
/usr/src/zlib-1.1.4directory. - Run the
./configurescript. - Run the
makeprogram with the argumenttest. - Run the
makeprogram with the argumentinstall.
Configuring, compiling and installing OpenSSH
- Change to the
/usr/srcdirectory. - Extract the source code from the
.tar.gzfile. - Change to the
/usr/src/openssh-3.5p1directory. - Run the
./configurescript. - Run the
makeprogram. - Run the
makeprogram with the argumentinstall.
Using the SSH Client
- At the command prompt enter the line:
where
/usr/local/bin/ssh -p 22 user@192.168.0.1useris a valid username on the remote system and192.168.0.1is the IP address or FQDN of the remote system. The value of-p 22is the remote port on which the SSH server is listening. - Accept the authentication key when prompted.
- Enter the user password for the remote machine when prompted. You will be given the system prompt of the remote machine.
- Enter
logoutat the remote prompt to finish the SSH session.
Starting sshd
- Add the user
sshdto the system. - Start the sshd daemon.
- Attempt to connect to sshd from your other computer using a SSH client.
Stopping sshd
- Stop the sshd using
kill `cat /var/run/sshd.pid`.
Automating sshd
- Append the following line to the
/etc/rc.d/rc.muscript:You can also add comments and echoes for your own information./usr/local/sbin/sshd -p 22 - Insert the following line at the second line of the
/etc/rc.d/rc.rbscript:You can also add comments and echoes for your own information.kill `cat /var/run/sshd.pid` - Insert the following line at the second line of the
/etc/rc.d/rc.hascript:You can also add comments and echoes for your own information.kill `cat /var/run/sshd.pid` - Reboot the system and check that sshd is running.

The text of this page is licensed under a Creative Commons License.
