Hier habe ich bereits überprüft und konfiguriert:
- SSH -Konfiguration (/etc/ssh/sshd_config)
ErlaubnisLogin Ja
PubkeyAuthentication Ja
Ich glaube, meine Konfiguration ist Richtig, da ich nach dem Neustart des Servers kurz eine Verbindung herstellen kann, aber die Verbindung fällt kurz danach ab. Jede Hilfe wird sehr geschätzt! < /P>
Dies ist das Protokoll: < /p>
Code: Select all
Last login: Mon Feb 10 15:14:36 2025 from 100.104.192.181
root@test:~# systemctl status sshd
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2025-02-10 09:30:58 CST; 5h 43min ago
Docs: man:sshd(8)
man:sshd_config(5)
Process: 1000 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
Main PID: 1033 (sshd)
Tasks: 1 (limit: 1910)
Memory: 11.6M
CPU: 1.102s
CGroup: /system.slice/ssh.service
└─1033 "sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups"
Feb 10 14:07:39 test sshd[10203]: Connection closed by 45.79.181.223 port 39154 [preauth]
Feb 10 14:07:41 test sshd[10205]: Connection closed by 45.79.181.223 port 39168 [preauth]
Feb 10 15:14:20 test sshd[10286]: error: Received disconnect from 100.104.192.167 port 45714:10: [preauth]
Feb 10 15:14:20 test sshd[10286]: Disconnected from authenticating user root 100.104.192.167 port 45714 [preauth]
Feb 10 15:14:35 test sshd[10288]: Accepted publickey for root from 100.104.192.152 port 47699 ssh2: RSA SHA256:kjEMuGZGOCGmGJ9DCIK3OPVIammPbfBNMb3NqviL1v4
Feb 10 15:14:35 test sshd[10288]: pam_unix(sshd:session): session opened for user root(uid=0) by (uid=0)
Feb 10 15:14:36 test sshd[10307]: Accepted publickey for root from 100.104.192.181 port 33229 ssh2: RSA SHA256:kjEMuGZGOCGmGJ9DCIK3OPVIammPbfBNMb3NqviL1v4
Feb 10 15:14:36 test sshd[10307]: pam_unix(sshd:session): session opened for user root(uid=0) by (uid=0)
Feb 10 15:14:37 test sshd[10440]: Accepted publickey for root from 100.104.192.181 port 33239 ssh2: RSA SHA256:kjEMuGZGOCGmGJ9DCIK3OPVIammPbfBNMb3NqviL1v4
Feb 10 15:14:37 test sshd[10440]: pam_unix(sshd:session): session opened for user root(uid=0) by (uid=0)
root@test:~# systemctl status sshd
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2025-02-10 09:30:58 CST; 5h 56min ago
Docs: man:sshd(8)
man:sshd_config(5)
Process: 1000 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
Main PID: 1033 (sshd)
Tasks: 1 (limit: 1910)
Memory: 9.3M
CPU: 1.483s
CGroup: /system.slice/ssh.service
└─1033 "sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups"
Feb 10 15:27:20 test sshd[11131]: pam_unix(sshd:session): session closed for user root
Feb 10 15:27:22 test sshd[11179]: Accepted publickey for root from 100.104.192.181 port 41149 ssh2: RSA SHA256:kjEMuGZGOCGmGJ9DCIK3OPVIammPbfBNMb3NqviL1v4
Feb 10 15:27:22 test sshd[11179]: pam_unix(sshd:session): session opened for user root(uid=0) by (uid=0)
Feb 10 15:27:23 test sshd[11179]: pam_unix(sshd:session): session closed for user root
Feb 10 15:27:23 test sshd[11227]: Accepted publickey for root from 100.104.192.181 port 41161 ssh2: RSA SHA256:kjEMuGZGOCGmGJ9DCIK3OPVIammPbfBNMb3NqviL1v4
Feb 10 15:27:23 test sshd[11227]: pam_unix(sshd:session): session opened for user root(uid=0) by (uid=0)
Feb 10 15:27:24 test sshd[11227]: pam_unix(sshd:session): session closed for user root
Feb 10 15:27:25 test sshd[11275]: Accepted publickey for root from 100.104.192.181 port 41172 ssh2: RSA SHA256:kjEMuGZGOCGmGJ9DCIK3OPVIammPbfBNMb3NqviL1v4
Feb 10 15:27:25 test sshd[11275]: pam_unix(sshd:session): session opened for user root(uid=0) by (uid=0)
Feb 10 15:27:25 test sshd[11275]: pam_unix(sshd:session): session closed for user root