SSH service in openSUSE and SLES is provided by the openssh-server package. openssh-server is installed by default, but the SSH server service is not enabled. Enabling a service will start the server during system boot, which means that even though the SSH server is installed, you still can't use it out of the box.
You can enable SSH service during installation of openSUSE and SLES at the Security section on the Installation Settings screen by setting up the following options:
- Firewall will be enabled
- SSH service will be enabled
- SSH port will be open
If you missed the option during installation, you could manually install and start the SSH service along with the necessary configurations from the terminal.
Steps to install and enable SSH server on SUSE:
- Refresh zypper's package list.
> sudo zypper refresh
- Install openssh package if not already installed (optional).
> sudo zypper install --no-confirm openssh
- Start sshd service via systemd.
> sudo systemctl start sshd
- 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.
- 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.
- Enable firewall rule for ssh.
> sudo firewall-cmd --permanent --add-service=ssh success
- Reload firewall rules.
> sudo firewall-cmd --reload success
Author: Mohd
Shakir Zakaria
Mohd Shakir Zakaria is an experienced cloud architect with a strong development and open-source advocacy background. He boasts multiple certifications in AWS, Red Hat, VMware, ITIL, and Linux, underscoring his expertise in cloud architecture and system administration.
Mohd Shakir Zakaria is an experienced cloud architect with a strong development and open-source advocacy background. He boasts multiple certifications in AWS, Red Hat, VMware, ITIL, and Linux, underscoring his expertise in cloud architecture and system administration.
Discuss the article:
Comment anonymously. Login not required.