The tutorial will explain the basics behind SSH server and SSH client connections on Fedora Linux Workstation. By default the SSH server on Fedora Workstation may be installed but not enabled. This will cause a following error message when connecting via SSH client:
ssh: connect to host fedora-workstation port 22: Connection refused
In this tutorial you will learn:
- How to Install SSH server
- How to enable SSH server
- How to Start SSH server
- How to Connect to SSH server
Software Requirements and Conventions Used
Category | Requirements, Conventions or Software Version Used |
---|---|
System | Fedora 30 |
Software | OpenSSH |
Other | Privileged access to your Linux system as root or via the sudo command. |
Conventions |
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command$ – requires given linux commands to be executed as a regular non-privileged user |
Enable and start SSH server on Fedora Workstation step by step instructions
- First step is to check whether the
openssh-server
is installed on your Fedora system. To do so execute the following command which in case the SSH server is install should produce a relevant output. Example:$ rpm -qa | grep openssh-server openssh-server-7.9p1-5.fc30.x86_64
In case the above command did not produced any output use the
dnf
command install packageopenssh-server
:$ sudo dnf install openssh-server
- Next step is to enable systemd service
sshd
to make sure that SSH daemon will start after the reboot:$ sudo systemctl enable sshd
- Once the
SSHD
service is enable use once again thesystemclt
command to start SSH server:$ sudo systemctl start sshd
Once ready check the SSH server status using the following command:
$ sudo systemctl status sshd
Furthermore, you should now see the port
22
open for a new incoming connections:$ sudo ss -lt
NOTE
In case you are running a firewall you might need to first open the SSH port. Otherwise your incoming SSH connection will be refused. - Now, we are ready to connect to the SSH server on the Fedora Workstation system. Example:
$ ssh username@fedora-ip-or-hostname