Objective 7: Set Up Secure Shell (OpenSSH)

This section explains how to acquire, compile, install, and configure OpenSSH for Linux, so that you can use it in place of telnet, rsh, and rlogin. For more information about using ssh, see Chapter 40, Objective 4: Secure Shell and SSH, The Secure Shell: The Definitive Guide (O'Reilly).

In the unlikely event that your Linux distribution does not include OpenSSH, it is available at http://www.openssh.com/portable.html and at many mirror sites around the world. It is a simple matter to compile and install OpenSSH if you have gcc, make, and the necessary libraries and header files installed. The OpenSSH build uses autoconf (the usual configure, make, and so on) like most other open source projects. See Chapter 4 for more information on building software in general, and see the INSTALL file in the top level of the source tree, or ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/INSTALL for more information on building OpenSSH specifically (such as what libraries are required and what options can be passed to configure).

To enable login from remote systems using OpenSSH, you must start sshd, which may be done simply by issuing the following command:

# sshd

Note that you do not need to put this command in the background, as it handles this detail itself. Once the sshd daemon is running, you may connect from another SSH-equipped system:

# ssh mysecurehost

The default configuration should be adequate for basic use of SSH.

Get LPI Linux Certification in a Nutshell, 2nd 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.