Share!

SSH service in openSUSE / SLES is provided by the openssh-server package which is automatically installed but not enabled during installation. It means that SSH service does not automatically start during system boot and you will not be able to log in to your machine via SSH even though it is already installed.

You can enable SSH service during installation of openSUSE and SLES at the Firewall and SSH section on the Installation Settings screen.

For this you'll have to set the options to the followings before clicking the Install button:

  • Firewall will be enabled
  • SSH service will be enabled
  • SSH port will be open

If you missed the option during installation or simply just need it later, you can manually install and configure the necessary at the terminal.

Tutorial video:


Install and enable SSH server on SUSE:

  1. Refresh zypper's package list.
    > sudo zypper refresh
  2. Install openssh package if not already installed (optional).
    > sudo zypper install --no-confirm openssh
  3. Start sshd service via systemd.
    > sudo systemctl start sshd
  4. Check if sshd is successfully started (optional).
    > 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 sshd during system startup.
    > sudo systemctl enable sshd
    Created symlink /etc/systemd/system/multi-user.target.wants/sshd.service → /usr/lib/systemd/system/sshd.service.
  6. Enable firewall rule for ssh.
    > sudo firewall-cmd --permanent --add-service=ssh
    success
  7. Reload firewall rules.
    > sudo firewall-cmd --reload
    success

Guide compatibility:

Operating System
openSUSE Tumbleweed
openSUSE Leap 15.1
openSUSE Leap 15.0
SUSE Linux Enterprise Server 15
SUSE Linux Enterprise Server 12