Skip to content

Set Up SSH on a Linux Server – Secure Remote Access

Learn how to securely install and manage an SSH server on Linux to enable secure remote access and better protect your server → Find out more

12 November 20263 min read101 Views0 helpful

Introduction

Secure Shell (SSH) is a secure protocol that provides encrypted access to remote systems. It helps ensure the confidentiality and integrity of data transmitted over networks.

In this guide, you’ll learn how to install or reinstall the SSH server on the various Linux distributions we currently offer on our VPS and dedicated servers. Most Linux distributions we offer on our VPS and dedicated servers come with an SSH server installed by default, which you can easily manage through the product’s web interface. Find out how in our guide: First access (SSH)

If you’d like to further improve your server’s security, we recommend our security tips, where you’ll find many tools and services to help make your server even more secure.

Installation

To get started, access your server through VNC. Just follow the steps in the VNC console.

CentOS

Info

If you want to reinstall the SSH server, uninstall it first with: yum remove openssh.

Before installing the SSH server, make sure your system is up to date. Run the following command:

Code
yum update

Now install the SSH server with this command:

Code
yum install openssh-server

After installation, start the SSH server with:

Code
systemctl start sshd

To start the service automatically when the system boots, enable it with:

Code
systemctl enable sshd

Enable root login

To allow root login, you need to edit the OpenSSH configuration file. We’ll use the "nano" editor here.

Info

If "nano" isn’t installed yet, you can install it with yum install nano.

Open the configuration file with:

Code
nano /etc/ssh/sshd_config 

Use the arrow keys to navigate to this line:

Code
#PermitRootLogin prohibit-password

Change it to:

Code
PermitRootLogin yes

Restart the SSH server for the change to take effect:

Code
systemctl restart sshd

Debian

Info

If you want to reinstall the SSH server, uninstall it first with: apt remove openssh.

Update your system before installation:

Code
apt update

Install the SSH server with:

Code
apt install openssh-server

Start the SSH server:

Code
systemctl start sshd

Enable the service to start automatically at boot:

Code
systemctl enable sshd

Enable root login

To allow root login, edit the OpenSSH configuration file using "nano".

Info

If "nano" isn’t installed yet, install it with: apt install nano

Open the file:

Code
nano /etc/ssh/sshd_config 

Find this line:

Code
#PermitRootLogin prohibit-password

Change it to:

Code
PermitRootLogin yes

Restart the SSH server for the change to take effect:

Code
systemctl restart sshd

Ubuntu

Info

If you want to reinstall the SSH server, uninstall it first with: apt remove openssh.

Update your system before installation:

Code
apt update

Install the SSH server with:

Code
apt install openssh-server

Start the SSH server:

Code
systemctl start sshd

Enable the service to start automatically at boot:

Code
systemctl enable sshd

Enable root login

To allow root login, edit the OpenSSH configuration file using "nano".

Info

If "nano" isn’t installed yet, install it with: apt install nano

Open the file:

Code
nano /etc/ssh/sshd_config 

Find this line:

Code
#PermitRootLogin prohibit-password

Change it to:

Code
PermitRootLogin yes

Restart the SSH server for the change to take effect:

Code
systemctl restart sshd

Fedora

Info

If you want to reinstall the SSH server, uninstall it first with: dnf remove openssh.

Update your system before installation:

Code
dnf update

Install the SSH server with:

Code
dnf install openssh-server

Start the SSH server:

Code
systemctl start sshd

Enable the service to start automatically at boot:

Code
systemctl enable sshd

Enable root login

To allow root login, edit the OpenSSH configuration file using "nano".

Info

If "nano" isn’t installed yet, install it with: dnf install nano

Open the file:

Code
sudo nano /etc/ssh/sshd_config 

Find this line:

Code
#PermitRootLogin prohibit-password

Change it to:

Code
PermitRootLogin yes

Restart the SSH server for the change to take effect:

Code
systemctl restart sshd

You’ve now successfully installed the SSH service on your server and can connect to it using SSH.

Free tools

Related tools for servers and developers

View all

FAQ

Frequently asked questions

Yes. Most Linux distributions offered by ZAP-Hosting come with an SSH server installed by default, which you can easily manage through the product’s web interface.
Access your server through the VNC console, update your system with yum update, then install the SSH server with yum install openssh-server. To reinstall it, uninstall it first with yum remove openssh.
Run systemctl start sshd. To start the service automatically when the system boots, enable it as well.

Feedback

Was this article helpful?

Your feedback helps us prioritize and improve content.

0 of 0 people found this article helpful.

Personal support

Need more help than the guide provides?

Our ZAP-Hosting support team knows your product — briefly describe your issue and we'll help you personally.

Zappy knows this guide and answers you right in the chat.