How to Use OpenSSH to Connect to Your Linux Server

Angel Leon-Glass
by Atlantic.Net (2posts) under Cloud Hosting
0 Comments

Introduction

This how-to will show how to use the OpenSSH program to connect one Linux server to another via command line. It’s a very simple process that requires little know-how, but can be useful for many projects. Normally, on Windows, you would just use the software PuTTY to connect through SSH, but this isn’t available for Linux devices.

Prerequisites

  • Root/administrative access to your server. If you do not have a server and need one, Atlantic.Net offers reliable cloud hosting options.

Installing OpenSSH

With most versions of Linux, OpenSSH already comes installed for client and server side. To make sure it’s installed on both ends, we will first run an install on both sides. Run the following commands to install the server and client software needed:

Ubuntu/Debian:

sudo apt-get install -y openssh-server openssh-client

CentOS/Fedora (Fedora uses ‘dnf’ now, but will still install with ‘yum’):

sudo yum install -y openssh-server openssh-client

FreeBSD:

sudo pkg install openssh-server openssh-client

ArchLinux:

sudo pacman -S openssh

Once OpenSSH is installed, make sure the service is running. You can check if it’s running with the following:

CentOS/Fedora/FreeBSD/Ubuntu/Debian:

service sshd status

ArchLinux:

systemctl status sshd

Connecting to an External Server

At this point, you’re ready to connect! Normal syntax for connecting with OpenSSH is as follows:

ssh <[email protected] or [email protected]>

Once you connect to your external device, you’ll see the following which is the RSA negotiation between both devices to ensure you’re connecting to the right host:

The authenticity of host '69.28.xx.xx (69.28.xx.xx)' can't be established.
RSA key fingerprint is 75:98:a9:3d:f8:e7:48:bf:05:c9:1b:ea:xx:xx:xx:xx.
Are you sure you want to continue connecting (yes/no)? yes

You can choose to add this RSA key permanently to your SSH configuration so this external host is permanently stored with this key. This is normally seen as fine unless you’ll be modifying the SSH configuration of the external host frequently. This will prevent people with malicious intent from impersonating the server you’re connecting to or from performing ‘man-in-the-middle’ attacks.

Warning: Permanently added '69.28.xx.xx' (RSA) to the list of known hosts.

Afterwards, you will be prompted for the password of the user you logged in as. If you didn’t specify a user, it will automatically log in as ‘root’.

[email protected]'s password:
Last login: Mon Apr 25 06:25:43 2016 from 209.208.xx.xx

Enter the password for your user and you’re good to go!

Thank you for following along with this how to on connecting to your Linux server with OpenSSH. Learn more about our affordable cloud hosting solutions and be sure to check back with us again for updates and further tutorials, like How to SSH to Server via Linux.


Related Posts


New York, NY

100 Delawanna Ave, Suite 1

Clifton, NJ 07014

United States

Dallas, TX

2323 Bryan Street,

Dallas, Texas 75201

United States

San Francisco, CA

2820 Northwestern Pkwy,

Santa Clara, CA 95051

United States

Orlando, FL

440 W Kennedy Blvd, Suite 3

Orlando, FL 32810

United States

London, UK

14 Liverpool Road, Slough,

Berkshire SL1 4QZ

United Kingdom

Toronto, Canada

20 Pullman Ct, Scarborough,

Ontario M1X 1E4

Canada

Resources

We use cookies for advertising, social media and analytics purposes. Read about how we use cookies in our updated Privacy Policy. If you continue to use this site, you consent to our use of cookies and our Privacy Policy.