Client bookworm keine SSH Verbindung

Probleme mit Samba, NFS, FTP und Co.
Antworten
Benutzeravatar
AlexDausF
Beiträge: 598
Registriert: 08.01.2008 17:54:05
Wohnort: Frankfurt am Main

Client bookworm keine SSH Verbindung

Beitrag von AlexDausF » 02.07.2023 19:18:33

Hallo!

Ich habe ein NAS auf welches ich mich per SSH, SFTP oder SSHFS wunderbar anmelden kann. Ich habe jetzt meinen Laptop auf Debian 12 gehoben und versuche nun von diesem Laptop auch auf den Server zuzugreifen. Doch das geht leider nicht mehr.
sshfs: read: Connection reset by peer
ssh: no matching host key file
Passwortanmeldung ist auf dem Server aktiv, es geht ja auch von den anderen Rechnern. Was ist auf Debian Bookworm anders, das es jetzt nicht mehr geht?
Vielen Dank für Eure Tips!
Alex

Benutzeravatar
Draal
Beiträge: 543
Registriert: 11.03.2005 14:45:26

Re: Client bookworm keine SSH Verbindung

Beitrag von Draal » 02.07.2023 19:38:20

Eigentlich ist gar nichts anders. ssh funktioniert, von trixie auf ein bookworm nas, intern, wie extern. Hat, denke ich ,weniger mit der Distribution zu tun, eher mit dem Protokoll. Sieht so aus, als ob Du einen neuen Schlüssel von Deinem NAS brauchst.

Benutzeravatar
AlexDausF
Beiträge: 598
Registriert: 08.01.2008 17:54:05
Wohnort: Frankfurt am Main

Re: Client bookworm keine SSH Verbindung

Beitrag von AlexDausF » 02.07.2023 19:40:41

Ich möchte noch etwas ergänzen: Es geht nur auf dem NAS nicht, dort ist das Betriebsystem sehr alt. Sind extrem alte Versionen von ssh nicht mehr mit Bookworm kompatibel? Naja ich muss den NAS eh mal neu aufsetzen....
Ich melde mich schon immer mit dem Passwort an. Hatte noch nie Schlüssel erstellt.
Besten Dank!

Benutzeravatar
Draal
Beiträge: 543
Registriert: 11.03.2005 14:45:26

Re: Client bookworm keine SSH Verbindung

Beitrag von Draal » 02.07.2023 19:51:31

AlexDausF hat geschrieben: ↑ zum Beitrag ↑
02.07.2023 19:40:41
Ich melde mich schon immer mit dem Passwort an. Hatte noch nie Schlüssel erstellt.
Bei der ersten ssh Verbindung, egal mit welchem System, wird immer ein Schlüssel getauscht.

Benutzeravatar
MSfree
Beiträge: 10777
Registriert: 25.09.2007 19:59:30

Re: Client bookworm keine SSH Verbindung

Beitrag von MSfree » 02.07.2023 20:31:38

AlexDausF hat geschrieben: ↑ zum Beitrag ↑
02.07.2023 19:40:41
Es geht nur auf dem NAS nicht, dort ist das Betriebsystem sehr alt. Sind extrem alte Versionen von ssh nicht mehr mit Bookworm kompatibel?
Die Protokollversion 1 wurde vor längerer Zeit aus OpenSSH entfernt. Gut möglich, daß dein NAS noch Protokollversion 1 will. Version 2 wurde aber auch schon vor einer Ewigkeit eingeführt, mit Glück kannst du das NAS auf Version 2 umstellen.

Was ergibt

Code: Alles auswählen

ssh -vvv benutzer@nas
?

Benutzeravatar
AlexDausF
Beiträge: 598
Registriert: 08.01.2008 17:54:05
Wohnort: Frankfurt am Main

Re: Client bookworm keine SSH Verbindung

Beitrag von AlexDausF » 02.07.2023 22:06:21

Hallo!

das habe ich mal kopiert:

Code: Alles auswählen

debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/alex/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/alex/.ssh/known_hosts2'
debug3: ssh_connect_direct: entering
debug1: Connecting to 
debug3: set_sock_tos: set socket 3 IP_TOS 0x10
debug1: Connection established.
debug1: identity file /home/alex/.ssh/id_rsa type -1
debug1: identity file /home/alex/.ssh/id_rsa-cert type -1
debug1: identity file /home/alex/.ssh/id_ecdsa type -1
debug1: identity file /home/alex/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/alex/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/alex/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /home/alex/.ssh/id_ed25519 type -1
debug1: identity file /home/alex/.ssh/id_ed25519-cert type -1
debug1: identity file /home/alex/.ssh/id_ed25519_sk type -1
debug1: identity file /home/alex/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /home/alex/.ssh/id_xmss type -1
debug1: identity file /home/alex/.ssh/id_xmss-cert type -1
debug1: identity file /home/alex/.ssh/id_dsa type -1
debug1: identity file /home/alex/.ssh/id_dsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_9.2p1 Debian-2
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.0p1 Debian-4+deb7u7
debug1: compat_banner: match: OpenSSH_6.0p1 Debian-4+deb7u7 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to 
debug1: load_hostkeys: fopen /home/alex/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug3: order_hostkeyalgs: no algorithms matched; accept original
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: sntrup761x25519-sha512@openssh.com,curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,ext-info-c
debug2: host key algorithms: ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com,zlib
debug2: compression stoc: none,zlib@openssh.com,zlib
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: host key algorithms: ssh-rsa,ssh-dss
debug2: ciphers ctos: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: ciphers stoc: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: MACs ctos: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: MACs stoc: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: compression ctos: none
debug2: compression stoc: none
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug1: kex: algorithm: ecdh-sha2-nistp256
debug1: kex: host key algorithm: (no match)
Unable to negotiate with xxxxxxxxxxxxxxx: no matching host key type found. Their offer: ssh-rsa,ssh-dss

Benutzeravatar
AlexDausF
Beiträge: 598
Registriert: 08.01.2008 17:54:05
Wohnort: Frankfurt am Main

Re: Client bookworm keine SSH Verbindung

Beitrag von AlexDausF » 02.07.2023 22:08:23

Das ist natürlich eine Erklärung. Komisch nur, dass ich von einem Bullseye Rechner drauf komme, nur vom Bookworm Rechner nicht. :?:

mat6937
Beiträge: 2953
Registriert: 09.12.2014 10:44:00

Re: Client bookworm keine SSH Verbindung

Beitrag von mat6937 » 02.07.2023 22:11:20

AlexDausF hat geschrieben: ↑ zum Beitrag ↑
02.07.2023 22:06:21
Unable to negotiate with xxxxxxxxxxxxxxx: no matching host key type found. Their offer: ssh-rsa,ssh-dss[/code]
BTW: type ist nicht file.

Versuch mal mit:

Code: Alles auswählen

ssh -oHostKeyAlgorithms=+ssh-dss benutzer@nas

Benutzeravatar
MSfree
Beiträge: 10777
Registriert: 25.09.2007 19:59:30

Re: Client bookworm keine SSH Verbindung

Beitrag von MSfree » 02.07.2023 22:17:24

AlexDausF hat geschrieben: ↑ zum Beitrag ↑
02.07.2023 22:06:21

Code: Alles auswählen

debug1: Remote protocol version 2.0, remote software version OpenSSH_6.0p1 Debian-4+deb7u7
Am Protokoll liegt es schonmal nicht, denn das NAS spricht Version 2.0.

Code: Alles auswählen

debug1: load_hostkeys: fopen /home/alex/.ssh/known_hosts2: No such file or directory
Das ist allerdings ungewöhnlich.
1. sucht er die Datei /home/alex/.ssh/known_hosts2, die es nicht zu geben scheint.
2. sollte die Datei /home/alex/.ssh/known_hosts (ohne 2) heiißen.
Was ist denn da zerkonfiguriert?

mat6937
Beiträge: 2953
Registriert: 09.12.2014 10:44:00

Re: Client bookworm keine SSH Verbindung

Beitrag von mat6937 » 02.07.2023 22:29:38

Draal hat geschrieben: ↑ zum Beitrag ↑
02.07.2023 19:38:20
Eigentlich ist gar nichts anders.
Das:

Code: Alles auswählen

:~# ssh -Q HostKeyAlgorithms
ssh-ed25519
ssh-ed25519-cert-v01@openssh.com
sk-ssh-ed25519@openssh.com
sk-ssh-ed25519-cert-v01@openssh.com
ssh-rsa
rsa-sha2-256
rsa-sha2-512
ssh-dss
ecdsa-sha2-nistp256
ecdsa-sha2-nistp384
ecdsa-sha2-nistp521
sk-ecdsa-sha2-nistp256@openssh.com
webauthn-sk-ecdsa-sha2-nistp256@openssh.com
ssh-rsa-cert-v01@openssh.com
rsa-sha2-256-cert-v01@openssh.com
rsa-sha2-512-cert-v01@openssh.com
ssh-dss-cert-v01@openssh.com
ecdsa-sha2-nistp256-cert-v01@openssh.com
ecdsa-sha2-nistp384-cert-v01@openssh.com
ecdsa-sha2-nistp521-cert-v01@openssh.com
sk-ecdsa-sha2-nistp256-cert-v01@openssh.com
sind die "HostKeyAlgorithms" vom ssh-Client im bullseye. Wie sind die im bookworm?

EDIT:

Mit bookworm hat sich die Vorgabe (default) geändert:

Code: Alles auswählen

ssh-ed25519-cert-v01@openssh.com,
ecdsa-sha2-nistp256-cert-v01@openssh.com,
ecdsa-sha2-nistp384-cert-v01@openssh.com,
ecdsa-sha2-nistp521-cert-v01@openssh.com,
sk-ssh-ed25519-cert-v01@openssh.com,
sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
rsa-sha2-512-cert-v01@openssh.com,
rsa-sha2-256-cert-v01@openssh.com,
ssh-ed25519,
ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
sk-ecdsa-sha2-nistp256@openssh.com,
sk-ssh-ed25519@openssh.com,
rsa-sha2-512,rsa-sha2-256
... und das ist bullseye:

Code: Alles auswählen

ecdsa-sha2-nistp256-cert-v01@openssh.com,
ecdsa-sha2-nistp384-cert-v01@openssh.com,
ecdsa-sha2-nistp521-cert-v01@openssh.com,
sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
ssh-ed25519-cert-v01@openssh.com,
sk-ssh-ed25519-cert-v01@openssh.com,
rsa-sha2-512-cert-v01@openssh.com,
rsa-sha2-256-cert-v01@openssh.com,
ssh-rsa-cert-v01@openssh.com,
ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
sk-ecdsa-sha2-nistp256@openssh.com,
 ssh-ed25519,sk-ssh-ed25519@openssh.com,
 rsa-sha2-512,rsa-sha2-256,ssh-rsa
ssh-rsa (was sein NAS hat) ist im bookworm nicht mehr per default vorhanden.

Benutzeravatar
AlexDausF
Beiträge: 598
Registriert: 08.01.2008 17:54:05
Wohnort: Frankfurt am Main

Re: Client bookworm keine SSH Verbindung

Beitrag von AlexDausF » 03.07.2023 07:07:49

mat6937 hat geschrieben: ↑ zum Beitrag ↑
02.07.2023 22:29:38

ssh-rsa (was se4in NAS hat) ist im bookworm nicht mehr per default vorhanden.
Könnte man das im bookworm Laptop nachinstallieren?
Vielen Dank!
Alex

mat6937
Beiträge: 2953
Registriert: 09.12.2014 10:44:00

Re: Client bookworm keine SSH Verbindung

Beitrag von mat6937 » 03.07.2023 09:02:43

AlexDausF hat geschrieben: ↑ zum Beitrag ↑
03.07.2023 07:07:49
Könnte man das im bookworm Laptop nachinstallieren?
Man muss es nicht nachinstallieren. Man kann schauen mit:

Code: Alles auswählen

ssh -Q HostKeyAlgorithms
ob es noch vorhanden ist (und davon gehe ich aus) und es (d. h. ssh-rsa) dann beim ssh-Client (bookworm) in der Kommandozeile (siehe oben für ssh-dss) und/oder noch besser in einer config des ssh-Clienten (... nur für den Host="dein NAS") benutzen.

Benutzeravatar
MSfree
Beiträge: 10777
Registriert: 25.09.2007 19:59:30

Re: Client bookworm keine SSH Verbindung

Beitrag von MSfree » 03.07.2023 10:09:48

Trage

Code: Alles auswählen

Host NameDeinesNAS
HostKeyAlgorithms +ssh-rsa
in die Datei ~/.ssh/config ein, dann wird ssh-rsa für die spezielle Verbindung wieder aktiviert.

Benutzeravatar
AlexDausF
Beiträge: 598
Registriert: 08.01.2008 17:54:05
Wohnort: Frankfurt am Main

Re: Client bookworm keine SSH Verbindung

Beitrag von AlexDausF » 03.07.2023 14:56:29

Hallo!

Eure Tipps waren Gold wert. Ich habe die Datei ~/home/user/.ssh/config erstellt und Deinen Text eingefügt. Und es läuft. :hail:
Ich probiere jetzt noch ob man da auch eine IP Adresse einfügen kann.

Besten Dank!
Alex
P.S. der NAS gehört trotzdem demnächst mal neu installiert.

Benutzeravatar
schorsch_76
Beiträge: 2544
Registriert: 06.11.2007 16:00:42
Lizenz eigener Beiträge: MIT Lizenz

Re: Client bookworm keine SSH Verbindung

Beitrag von schorsch_76 » 03.07.2023 21:20:05

Wheezy ist doch schon ein paar Jahre alt :mrgreen:

Benutzeravatar
AlexDausF
Beiträge: 598
Registriert: 08.01.2008 17:54:05
Wohnort: Frankfurt am Main

Re: Client bookworm keine SSH Verbindung

Beitrag von AlexDausF » 04.07.2023 07:16:09

:lol: es läuft eben und läuft und läuft.....

Antworten