To use the SSH service on openSUSE and SLES, the openssh-server package must be enabled. Although the package comes pre-installed, the service is not active by default. Activating this service is essential for enabling remote access.

During the installation of openSUSE or SLES, you can enable the SSH service through the Security section of the installation settings. This allows the system to start the SSH server and open the necessary port for remote connections. If this option is missed, manual configuration is required.

If SSH was not enabled during installation, it can be set up manually. This involves installing and starting the SSH service, and configuring it to start on boot. Additionally, firewall rules must be adjusted to allow SSH traffic. This ensures the system is securely accessible for remote management.

Step-by-step video guide:

Steps to install and enable SSH server on SUSE:

  1. Refresh the package list to ensure you have the latest updates.
    > sudo zypper refresh
  2. Install the openssh-server package if it is not already installed.
    > sudo zypper install --no-confirm openssh
  3. Start the sshd service using systemd.
    > sudo systemctl start sshd
  4. Verify that the sshd service is running correctly.
    > sudo systemctl status sshd
    ● sshd.service - OpenSSH Daemon
       Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: disabl>
       Active: active (running) since Sat 2018-06-02 23:06:28 +08; 41s ago
     Main PID: 10407 (sshd)
        Tasks: 1
       CGroup: /system.slice/sshd.service
               └─10407 /usr/sbin/sshd -D
    
    Jun 02 23:06:28 linux-tgtg systemd[1]: Starting OpenSSH Daemon...
    Jun 02 23:06:28 linux-tgtg sshd-gen-keys-start[10403]: Checking for missing server keys>
    Jun 02 23:06:28 linux-tgtg sshd-gen-keys-start[10403]: ssh-keygen: generating new host >
    Jun 02 23:06:28 linux-tgtg sshd[10407]: Server listening on 0.0.0.0 port 22.
    Jun 02 23:06:28 linux-tgtg sshd[10407]: Server listening on :: port 22.
    Jun 02 23:06:28 linux-tgtg systemd[1]: Started OpenSSH Daemon.
  5. Enable the sshd service to start automatically during system boot.
    > sudo systemctl enable sshd
    Created symlink /etc/systemd/system/multi-user.target.wants/sshd.service → /usr/lib/systemd/system/sshd.service.
  6. Allow the SSH service through the firewall by adding the necessary rules.
    > sudo firewall-cmd --permanent --add-service=ssh
    success
  7. Reload the firewall rules to apply the changes.
    > sudo firewall-cmd --reload
    success
Discuss the article:

Comment anonymously. Login not required.