Table of Contents

How To Use SSH on Linux to Connect to a Remote Server

This information is provided for the Ubuntu/Debian editions of Linux used in the CS Department. Other Linux versions may vary.

What Is SSH?

SSH, or Secure Shell, is a protocol used to securely log onto remote systems (Not just computers but some routers, switches, etc). It is the most common way to access remote Linux and Unix-like servers.

The Linux tool for connecting to a system, that allows remote connections using SSH, is called, unsurprisingly, ssh. ssh is run from the command shell (CLI) or in a terminal emulator (e.g. gnome-terminal, konsole, xterm, rxvt, kvt, nxterm, & eterm) if your Linux install uses a GUI. The emulator is a program that opens a window and lets you interact with the shell.

Basic Syntax

The most basic form of the command is:

  ssh remote_host

The remote_host in this example is the IP address or domain name that you are trying to connect to.

This command assumes that your username on the remote system is the same as your username on your local system.

If your username is different on the remote system, you can specify it by using this syntax:

  ssh remote_username@remote_host

Once you have connected to the server, you will probably be asked to verify your identity by providing a password.

For advanced users, there is some information on how to generate keys to use instead of passwords.

To exit back into your local system, simply type:

  exit

You can find more information on Ubuntu SSH in the Ubuntu man pages