SSH is a widely used network protocol that enables users, particularly network administrators to access and control a system remotely. Using SSH, a user can log in to a remote system over the network, run commands, and transfer files from one system to another.
Note: The methods described here have been demonstrated on openSUSE Leap 15.3.
Enabling SSH on openSUSE
You do not need to install SSH on openSUSE as it comes installed by default. You can verify it through the command below in your system’s Terminal:
$ ssh -V
If you see the SSH version number in the output as shown below, it means SSH is installed on your system.
However, if for any reason SSH is not installed or have been removed, you can install it as shown below:
$ sudo zypper install openssh
Now you will have to provide the sudo password. Type the password and then press Enter. This will install OpenSSH to your openSUSE system.
SSH comes pre-installed but it is not enabled by default on the openSUSE. You can start the SSH service through the command below:
$ sudo rcsshd start
To verify if the SSH is started, use the command below:
$ sudo rcsshd status
The output below verifies that SSH service is started and running on our system.
Open port 22 in the Firewall
To connect to your SSH server from another system, you will need to open the default SSH port 22 in your firewall.
You can open port 22 in your firewall through this command:
$ sudo firewall-cmd --zone=public --add-port=22/tcp
To verify if the port has been added, run the command below:
$ sudo firewall-cmd --zone=public --list-ports
This command should list port 22 in the output.
Connecting to SSH Server
Now you can connect to your SSH server from a remote system.
1. Login to your remote system. Open the Terminal and run the below command to connect to the SSH server:
$ ssh user@ip_address -p port_number
For instance, to connect to the SSH server with an IP address 192.168.72.200 with the username kbuzdar (a user on the SSH server) on the default port 22, the command would be:
$ ssh [email protected]
Note: If you do not specify the port number in the above command, it will by default connect to port 22. You can also change the default SSH port to something other than 22 in Linux.
2. When you connect to the SSH server for the first time, you will be asked to confirm the identity of the server. Type yes and hit Enter to confirm.
3. After that you will be asked for the password. Type the password for the user account on the SSH server and hit Enter. After that, you will be connected to your SSH server and will get a command line you can use to run commands.
You can also configure passwordless SSH authentication to connect to the SSH server without using a password.
This is how you can enable SSH on your openSUSE system. After enabling the SSH server, it is important to secure your SSH server to avoid various security risks. For more information about SSH on openSUSE, visit this documentation.