Intro to Networking - How to Establish a Connection Using SSH

Overview


Readers will acquire a basic understanding of the Secure Shell (SSH) network protocol and learn how to connect to a device using an SSH client.

Most devices manufactured by Ubiquiti Networks run a Linux-based operating system, and can be interacted with at the command-line level. SSH provides a secure, encrypted method of remotely connecting to a device to access the Command Line Interface (CLI), assuming the device's IP address and access credentials are known. This allows for a safe way to read and write to device configuration, access logs, troubleshoot problems, and transfer files.

Table of Contents


 

Microsoft Windows


Back to Top

As Windows does not include a native SSH terminal client, third party software is required. PuTTY is an effective open-source SSH and Telnet client. PuTTY (putty.exe) is available for download from this website

Once you have downloaded and installed PuTTY, follow these steps to connect to the device of your choice:

  1. Open PuTTY: on the Basic options for your PuTTY session screen, enter the IP address of the device to connect to under Host Name, and leave Port as 22, unless the device's SSH port has been explicitly changed. Click Open.
  2. Click Yes to have PuTTY cache the Host Key as trusted: if this is the first time you have connected to this device with this client, a dialog box will warn you that the server's host key is not cached in the registry. Click Yes
    Find more information on host keys here.  
  3. Enter the Device's Username: PuTTY will open a console window, with a "login as:" prompt.  Enter the device's username, and press Enter.

    Note: If at any point during the login process you are idle for an extended period of time (after about 60 seconds), a dialog box with the following message may appear:
    Server unexpectedly closed network connection.  If this occurs, click OK, then right-click on the PuTTY window's title bar, and select Restart Session to try again. 
  4. Enter the password: a welcome banner may appear, and you will now be prompted to enter the password.  As you type, no characters will appear on screen for security purposes. Carefully enter the correct password, and press Enter.
  5. Device is ready to accept commands: if you entered valid credentials, you will be presented with the device's Welcome Banner.  A command prompt indicating your username and device name will indicate a successful connection and that the remote device is ready to accept your commands.

Mac OSX


Back to Top

Mac OSX offers its own built-in SSH terminal client, so no external download is required.

  1. Open the Terminal: which is located in Applications > Utilities > Terminal.
  2. A Terminal window will open: with a command prompt for the local machine awaiting commands.
  3. Connect to the server: by entering the command below then press Enter. Note: Where <username> is the username on the device, the <ServerIP> is the IP address of the device you wish to connect to.
    ssh <username>@<ServerIP>
  4. Enter Host Key as Trusted: if this is the first time you have connected to this device with this client, a message will warn you that the server's host key is not cached in the registry. Enter yes and press Enter to have the client cache the Host Key as trusted.
  5. Enter the password: a welcome banner may appear, and you will now be prompted to enter the password. As you type, no characters will appear on screen for security purposes. Carefully enter the correct password, and press Enter.
  6. The device is ready to accept commands: if you entered valid credentials, you will be presented with the device's Welcome banner.  A command prompt indicating your username and device name will indicate a successful connection and that the remote device is ready to accept your commands.

Linux


Back to Top

Most Linux distributions offer their own built-in SSH terminal client, so no external download is required.

  1. Open the Terminal: typically located under Utilities > Terminal in the Main Menu.  In most distributions, you can also open a Terminal by pressing CTRL+ALT+T.
  2. A Terminal window will open: with a command prompt for the local machine awaiting commands.
  3. Connect to the server by entering the following command, then press Enter. Note: Where <username> is the username on the device, the <ServerIP> is the IP address of the device you wish to connect to.  
     ssh <username>@<ServerIP> 
  4. Enter Host Key as Trusted: if this is the first time you have connected to this device with this client, a message will warn you that the server's host key is not cached in the registry.  Enter yes and press Enter to have the client cache the Host Key as trusted.
  5. Enter the password: a welcome banner may appear, and you will now be prompted to enter the password.  As you type while entering the password, no characters will appear on screen for security purposes.  Carefully enter the correct password, and press Enter.
  6. The device is ready to accept commands: if you entered valid credentials, you will be presented with the device's Welcome banner.  A command prompt indicating your username and device name will indicate a successful connection and that the remote device is ready to accept your commands.

Related Articles


Back to Top

UniFi - USG Port Forwarding Configuration and Troubleshooting

Powered by Zendesk