SSH Service-Namen – Distro-Unterschiede

Kategorie: SSH · Channel: #ssh


Das Problem

Auf Ubuntu heißt der SSH-Service: ssh
Auf allen anderen Systemen:       sshd

Wer das nicht weiß, sucht ewig nach dem "fehlenden" Dienst.

Service-Namen im Vergleich

System Service-Name Befehl
Ubuntu ssh systemctl status ssh
Debian ssh systemctl status ssh
RHEL / Rocky / AlmaLinux sshd systemctl status sshd
Arch Linux sshd systemctl status sshd
SUSE / openSUSE sshd systemctl status sshd
FreeBSD sshd service sshd status

⚠️ Ubuntu UND Debian: beide verwenden ssh – nicht sshd!


Alle wichtigen Befehle pro System

Ubuntu / Debian

systemctl status ssh
systemctl start ssh
systemctl stop ssh
systemctl restart ssh
systemctl reload ssh      # ← nach sshd_config Änderung
systemctl enable ssh

# Logs:
journalctl -u ssh
journalctl -u ssh -f      # live
journalctl -u ssh --since "1 hour ago"

RHEL / Rocky / AlmaLinux / Arch / SUSE

systemctl status sshd
systemctl start sshd
systemctl stop sshd
systemctl restart sshd
systemctl reload sshd     # ← nach sshd_config Änderung
systemctl enable sshd

# Logs:
journalctl -u sshd
journalctl -u sshd -f
journalctl -u sshd --since "1 hour ago"

# RHEL: auch in /var/log/secure
tail -f /var/log/secure | grep sshd

FreeBSD

# KEIN systemctl! KEIN journalctl!
service sshd status
service sshd start
service sshd stop
service sshd restart
service sshd reload       # ← nach sshd_config Änderung

# Aktivierung in /etc/rc.conf:
echo 'sshd_enable="YES"' >> /etc/rc.conf

# Logs:
tail -f /var/log/auth.log
grep sshd /var/log/auth.log

Warum heißt es auf Ubuntu/Debian "ssh"?

Historischer Grund:
Das Paket heißt "openssh-server" und installiert
den Service unter dem Namen "ssh" – nicht "sshd".

Das ist eine Debian-Tradition die Ubuntu übernommen hat.
Der Daemon heißt intern trotzdem sshd (Prozessname).

Prüfen:
ps aux | grep sshd         # Prozess heißt immer sshd
systemctl status ssh       # Service heißt ssh (Ubuntu/Debian)

Häufige Fehler

# Fehler auf Ubuntu:
systemctl status sshd
# Unit sshd.service could not be found.
# → Lösung: systemctl status ssh

# Fehler auf RHEL:
systemctl status ssh
# Unit ssh.service could not be found.
# → Lösung: systemctl status sshd

# Schnelle Diagnose auf unbekanntem System:
systemctl list-units | grep -i ssh
# zeigt den echten Service-Namen

Log-Pfade im Vergleich

System Log-Quelle Befehl
Ubuntu / Debian journald journalctl -u ssh
RHEL / Rocky journald + /var/log/secure journalctl -u sshd
Arch journald journalctl -u sshd
SUSE journald journalctl -u sshd
FreeBSD /var/log/auth.log tail -f /var/log/auth.log

Schnellreferenz

# Unbekanntes System – Service-Name finden:
systemctl list-units | grep -i ssh

# Ubuntu/Debian:
systemctl reload ssh && journalctl -u ssh -f

# RHEL/Rocky/Arch/SUSE:
systemctl reload sshd && journalctl -u sshd -f

# FreeBSD:
service sshd reload && tail -f /var/log/auth.log

# Überall: Prozess läuft?
ps aux | grep "[s]shd"

# Überall: Config-Test vor reload
sshd -t