Using Secure Shell (SSH)

SSH, also known as Secure Shell, is a replacement for the obsolete telnet command and rsh/rlogin/rcp suite. The primary use for SSH is to conduct encrypted shell sessions to remote hosts. However, it can also be used to copy files and to tunnel other protocols.

SSH is a server/client protocol offering sshd as the server and the ssh and scp commands as the client. The client connects to the server, they establish an encrypted session, and then the server demands authentication before finally logging in the client.

The ssh command can be used either to execute a single command and return to the local terminal, or to establish a remote session that acts and feels just like logging into the remote system. In this regard, ssh acts like the obsolete rsh command; used to log in, ssh acts like rlogin and telnet.

The scp command copies files and directories to or from a remote system, acting like the obsolete rcp command.

In addition to simple login sessions and file copying, SSH can also provide transparent port forwarding, and as an extension of this, X authentication and forwarding. When you have an SSH session, you can start an X client on the remote machine, and the X Window System protocol will travel encrypted over your connection and display on your local machine without the need for settings such as DISPLAY=foo:0 or the xhost or xauth commands.

The implementation of SSH generally used on Linux systems is OpenSSH.

Get LPI Linux Certification in a Nutshell, 3rd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.