CentOS 7 sshd_config-Fehler

CentOS 7 sshd_config-Fehler

Da sich meine IP-Adresse nicht oft ändert, möchte ich, dass nur meine IP-Adresse auf SSH meines Gen4 CentOS7 VPS-Servers zugreifen kann.

Dies ist der Inhalt der Konfigurationsdatei (ohne auskommentierte Zeilen) der Datei: /etc/ssh/sshd_config

HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
SyslogFacility AUTHPRIV
PermitRootLogin no
AuthorizedKeysFile  .ssh/authorized_keys
PasswordAuthentication no
PermitEmptyPasswords no
Match Address xx.xxx.xxx.xxx  #here is  my real ip address 
PasswordAuthentication yes
ChallengeResponseAuthentication no
GSSAPIAuthentication yes
GSSAPICleanupCredentials no
UsePAM yes
X11Forwarding yes
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE
AcceptEnv XMODIFIERS
Subsystem   sftp    /usr/libexec/openssh/sftp-server

Nach dem Rennen

sudo systemctl restart sshd.service

, ich habe folgenden Fehler erhalten:

Der Job für sshd.service ist fehlgeschlagen, da der Kontrollprozess mit einem Fehlercode beendet wurde. Weitere Informationen finden Sie unter „systemctl status sshd.service“ und „journalctl -xe“.

Nach dem Rennen:

systemctl status sshd.service

Das Ergebnis ist wie folgt:

sshd.service - OpenSSH server daemon
   Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Fri 2020-08-21 21:34:52 MST; 40s ago
     Docs: man:sshd(8)
           man:sshd_config(5)
  Process: 15994 ExecStart=/usr/sbin/sshd -D $OPTIONS (code=exited, status=255)
 Main PID: 15994 (code=exited, status=255)

Ich kann nicht herausfinden, was falsch ist. Für jede Hilfe bin ich sehr dankbar.

Antwort1

Ich habe den Befehl ausgeführt:

sudo /usr/sbin/sshd -T

Ich habe folgende Fehlermeldung erhalten:

Directive 'ChallengeResponseAuthentication' is not allowed within a Match block

Also habe ich meinen Match-Block in den letzten Teil der Datei verschoben, das hat mein Problem gelöst.

Vielen Dank an alle für die Anleitungen.

verwandte Informationen