How to SSH to a Linux VPS Server

How to SSH to a Linux VPS Server

How to SSH to a Linux VPS Server

In the following article we will explain how to SSH to a remote Linux VPS Server.

What is SSH?

SSH, or Secure Shell, is a protocol used to securely log onto remote linux servers. It is the most common way to access remote Linux and Unix-like servers, such as VPS servers, Dedicated servers etc…

How SSH works?

The basic principles of SSH is that it allows you to securely interact with remote linux servers, for example run a session, transfer a file, configure or install some service or whatever.


BASIC SYNTAX

The command line tool used to connect to remote servers is called ssh. Its basic usage is as follows:

ssh remote_destination

where remote_destination can be either an IP address or a hostname which resolves to the server’s IP address.

 

CONFIGURING SSH ON YOUR SERVER

SSH server configuration file is usually located in /etc/ssh/sshd_config. To edit this configuration file you have to connect to your virtual server via SSH and use your favorite text editor to edit this configuration file, for example:

vim /etc/ssh/sshd_config

Few basic things to remember for the OpenSSH SSH daemon configuration file:

Port → Specifies the port number that sshd listens on. The default port is 22.

ListenAddress → Specifies the local addresses sshd should listen on.

PermitRootLogin → Specifies whether root can log in using ssh.

AuthorizedKeysFile → Specifies the file that contains the public keys that can be used for user authentication.

Keep in mind that you need to restart your SSH server if you’ve done changes to this configuration file. It depends on the Linux distribution you run on your Linux VPS, but usually this can be done using:

service ssh restart

or sometimes

service sshd restart

or even

systemctl restart sshd

 

CONNECTING VIA SSH USING *NIX

On a *NIX based machine, you can use your favorite terminal application to SSH to your virtual server. For example, let say your VPS hostname is my-linux-vps.com and you like to login with your root account, so you could do:

ssh [email protected]

 

CONNECTING VIA SSH USING WINDOWS

In Windows, you can use a program called Putty which you can download here. Once it’s downloaded, run it, and enter your VPS information as shown below:

putty-how-to-ssh