How to connect to SSH with Linux?
By Aina Manoa Ratefiarison • Posted on 27 March 2019
SSH is the main gateway to your server management. Here you can install and configure every services you need to be running on your server.
In order to practice this tutorial, you need :
- A running desktop Linux computer (any Linux distribution should be fine)
- A running VPS or Dedicated Server
- Internet connection
Step 1: install OpenSSH client
Before connecting to any Secure SHell host, you need to have an SSH client. Most installation should already bring OpenSSH client but to make sure to have it, we can try to install it.
Debian, Ubuntu (and other similar distributions)
email@example.com$ sudo apt-get install openssh-client
CentOS and RHEL based distributions
firstname.lastname@example.org$ sudo yum install openssh-client
Step 2: Connect to SSH
To connect to a remote server, open a terminal and write to following command:
email@example.com$ ssh user@host
Here, I’m connecting with the user user to the server host.
The host can be an IPv4 address, IPv6 address or a hostname. So, to connect as root to the server demo40.hostibox.com (10.0.40.1), we should write:
firstname.lastname@example.org$ ssh email@example.com
firstname.lastname@example.org$ ssh email@example.com
If you connect for the first time to this server, your computer will show the server fingerprint and ask you to confirm it. Just type yes.
Step 3: Log out with SSH
When you did everything you want, you should close your session. To do that, write exit inside your session:
Connection to demo40.hostibox.com closed.