Install/Enable & Connect to SSH on Fedora Linux 35

SSH or known by its full name Secure Shell Protocol, is a cryptographic network communication protocol that enables two computers to communicate securely over an unsecured network. SSH is highly used for remote login applications and command-line executables such as terminal applications.

For users wishing to connect to servers or other computers with SSH, the client and the remote connection need to both have SSH installed and enabled for this to be possible.

In the following tutorial, you will learn how to install and enable SSH on Fedora Linux 35 Workstation or Server and connect to a remote PC.

Prerequisites

  • Recommended OS: Fedora Linux 35 Workstation or Server.
  • User account: A user account with sudo or root access.
  • Internet Access

The tutorial will utilize the terminal, which can be found in your show applications menu.

Example:

Install/Enable & Connect to SSH on Fedora Linux 35

Update Operating System

Update your Fedora operating system to make sure all existing packages are up to date:

sudo dnf upgrade --refresh -y

The tutorial will be using the sudo command and assuming you have sudo status.

To verify sudo status on your account:

sudo whoami

Example output showing sudo status:

[joshua@fedora ~]$ sudo whoami
root

To set up an existing or new sudo account, visit our tutorial on Adding a User to Sudoers on Fedora.

Installing/Enabling SSH/SSHD (OpenSSH)

For Fedora users, depending on what installation you have installed, most often SSH/SSHD, which is named as “OpenSSH” on your Fedora system, may already be installed.

This can be checked using the following command.

rpm -qa | grep openssh-server

Example output:

openssh-server-8.8p1-1.fc36.1.x86_64

As above, for the system the tutorial is being conducted on SSH is already installed, for users that do not have the package and need to install it, run the following terminal command.

sudo dnf install openssh-server

Example output:

Install/Enable & Connect to SSH on Fedora Linux 35

Type Y, then press the ENTER KEY to proceed.

Once installed, by default, this should be enabled, but for users that have SSH present already on their system, you will need to run the enable command as, by default, for security purposes, it is disabled on fresh installations.

sudo systemctl enable sshd --now

Next, verify the status of SSH using the following command.

sudo systemctl status sshd

Example output:

Install/Enable & Connect to SSH on Fedora Linux 35

Another handy trick is to use the following command to see open connections.

sudo ss -lt

Example output:

Install/Enable & Connect to SSH on Fedora Linux 35

Connecting to SSH/SSHD Server

With SSH now installed and enabled, you can connect to a remote system, another remote PC, or a server. Remember, the SSH software must be enabled on both ends for this to work.

First, you will need to have the internal/external IP address or the hostname and preferably the username of the account connecting too, then use the ssh command to begin the connection.

ssh username@ip-address/hostname

When you connect to the remote SSH instance for the first time, you will receive the following message.

Example:

Type YES, then you will be prompted to enter your password; once done, press the ENTER KEY.

Example output:

Install/Enable & Connect to SSH on Fedora Linux 35

Disabling SSH/SSHD (OpenSSH)

For instances where you do not need SSH running, you should always have this disabled for security purposes. Many malicious bots scan the internet for SSH instances and brute force them if they are not secure.

To disable SSH, use the following command.

sudo systemctl disable sshd --now

When you need to have SSH re-enabled, use the following command.

sudo systemctl enable sshd --now

Comments and Conclusion

In the tutorial, you have learned how to install and enable SSH (OpenSSH) on Fedora Linux 35.

Overall, SSH is the go-to protocol compared to using other similar services such as TELNET which is not secure. However, ensure your firewalls are activated when using SSH over an open-unsecured network.



Follow LinuxCapable.com!

Like to get automatic updates? Follow us on one of our social media accounts!