Raspberrymatic Passwortloser SSH-Zugriff auf DoorPi

Einrichtung, Nutzung und Hilfe zu RaspberryMatic (OCCU auf Raspberry Pi)

Moderatoren: jmaus, Co-Administratoren

Bahni
Beiträge: 234
Registriert: 15.01.2011, 14:40
System: CCU und Access Point
Wohnort: Waldheim / Sachsen
Hat sich bedankt: 25 Mal

Re: Raspberrymatic Passwortloser SSH-Zugriff auf DoorPi

Beitrag von Bahni » 31.12.2018, 13:44

Code: Alles auswählen

login as: root
root@192.168.1.225's password:
# ssh -vvv pi@192.168.1.36
OpenSSH_7.8p1, OpenSSL 1.0.2p  14 Aug 2018
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: resolve_canonicalize: hostname 192.168.1.36 is address
debug2: ssh_connect_direct
debug1: Connecting to 192.168.1.36 [192.168.1.36] port 22.
debug1: Connection established.
debug1: identity file /root/.ssh/id_rsa type 0
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: identity file /root/.ssh/id_xmss type -1
debug1: identity file /root/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.8
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4p1 Raspbian-10+deb9u2
debug1: match: OpenSSH_7.4p1 Raspbian-10+deb9u2 pat OpenSSH_7.0*,OpenSSH_7.1*,OpenSSH_7.2*,OpenSSH_7.3*,OpenSSH_7.4*,OpenSSH_7.5*,OpenSSH_7.6*,OpenSSH_7.7* compat 0x04000002
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to 192.168.1.36:22 as 'pi'
debug3: hostkeys_foreach: reading file "/root/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file /root/.ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys from 192.168.1.36
debug3: order_hostkeyalgs: prefer hostkeyalgs: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
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: 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,diffie-hellman-group14-sha1,ext-info-c
debug2: host key algorithms: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,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,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
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: 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,diffie-hellman-group14-sha1
debug2: host key algorithms: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519
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
debug2: compression stoc: none,zlib@openssh.com
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug3: send packet: type 30
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug3: receive packet: type 31
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:RXPsj+FNt0yVvufYYfVpDEqB37VEaGBlhMOwF6VxNkI
debug3: hostkeys_foreach: reading file "/root/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file /root/.ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys from 192.168.1.36
debug1: Host '192.168.1.36' is known and matches the ECDSA host key.
debug1: Found key in /root/.ssh/known_hosts:1
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug1: SSH2_MSG_NEWKEYS received
debug2: set_newkeys: mode 0
debug1: rekey after 134217728 blocks
debug2: key: /root/.ssh/id_rsa (0x1255108)
debug2: key: /root/.ssh/id_dsa ((nil))
debug2: key: /root/.ssh/id_ecdsa ((nil))
debug2: key: /root/.ssh/id_ed25519 ((nil))
debug2: key: /root/.ssh/id_xmss ((nil))
debug3: send packet: type 5
debug3: receive packet: type 7
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,password
debug3: start over, passed a different list publickey,password
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:pn4KD4AC4B2AEHrypMWjZgLo1daZdtYAgH5kdD7EjQ0 /root/.ssh/id_rsa
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /root/.ssh/id_dsa
debug3: no such identity: /root/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /root/.ssh/id_ecdsa
debug3: no such identity: /root/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /root/.ssh/id_ed25519
debug3: no such identity: /root/.ssh/id_ed25519: No such file or directory
debug1: Trying private key: /root/.ssh/id_xmss
debug3: no such identity: /root/.ssh/id_xmss: No such file or directory
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
pi@192.168.1.36's password:
Zentrale: Charly RaspberryMatic (Pi4), Gateway: Raspberry Pi3 HM-MOD-RPI-PCB, 3 Stück Funk-Schaltaktor, 4-fach, 2 Stück Funk-Rollladenaktor für Markenschalter, 1 Stück 8-Kanal-Sendemodul, 1 Stück E-Paper-Display, 2 Stück Funk-Tür-/Fensterkontakt, WinMatic, 2 Stück Heizkörperthermostat HmIP-eTRV-2, Wandthermostat HmIP-WTH-2, weiterer Ausbau nach und nach geplant.

hoedlmoser
Beiträge: 215
Registriert: 19.01.2015, 07:42
Hat sich bedankt: 22 Mal
Danksagung erhalten: 8 Mal

Re: Raspberrymatic Passwortloser SSH-Zugriff auf DoorPi

Beitrag von hoedlmoser » 31.12.2018, 15:16

was sagen die log files am doorpi zum zeitpunkt des einlogversuchs? vor allem auth.log? zur not den sshd in debug versetzen.

verwende mal ssh-keygen ohne parameter.
verwende mal ssh-copy-id.

mach am doorpi mal

Code: Alles auswählen

ls -la /home/pi/.ssh/
RaspberryMatic 3.73.9.20231130 on Proxmox, HB-RF-ETH and Aurel Groundplane binded by openHAB 4.1.1

Bahni
Beiträge: 234
Registriert: 15.01.2011, 14:40
System: CCU und Access Point
Wohnort: Waldheim / Sachsen
Hat sich bedankt: 25 Mal

Re: Raspberrymatic Passwortloser SSH-Zugriff auf DoorPi

Beitrag von Bahni » 31.12.2018, 16:18

Habe jetzt "ssh-keygen" ohne Parameter eingeben und siehe da es funktioniert.
Gibt es dafür nun einen Grund?
Zentrale: Charly RaspberryMatic (Pi4), Gateway: Raspberry Pi3 HM-MOD-RPI-PCB, 3 Stück Funk-Schaltaktor, 4-fach, 2 Stück Funk-Rollladenaktor für Markenschalter, 1 Stück 8-Kanal-Sendemodul, 1 Stück E-Paper-Display, 2 Stück Funk-Tür-/Fensterkontakt, WinMatic, 2 Stück Heizkörperthermostat HmIP-eTRV-2, Wandthermostat HmIP-WTH-2, weiterer Ausbau nach und nach geplant.

TAOG
Beiträge: 35
Registriert: 22.08.2018, 20:35
Hat sich bedankt: 8 Mal
Danksagung erhalten: 1 Mal

Re: Raspberrymatic Passwortloser SSH-Zugriff auf DoorPi

Beitrag von TAOG » 31.12.2018, 16:31

ja klar.
ssh-keygen ist zum generieren eines Schlüssels.
ssh ist der ausführende Befehl...
• Raspberry Pi 3 Model B Plus Rev 1.3 • piVCCU3 • Homebridge für Siri • Redmatic • CCU-Historian 2.00-ß5

Bahni
Beiträge: 234
Registriert: 15.01.2011, 14:40
System: CCU und Access Point
Wohnort: Waldheim / Sachsen
Hat sich bedankt: 25 Mal

Re: Raspberrymatic Passwortloser SSH-Zugriff auf DoorPi

Beitrag von Bahni » 31.12.2018, 16:52

Das "ssh-keygen" zum generieren eines Schlüssels da ist ist klar.
Aber warum gehts mit "ssh-keygen -b -t rsa" nicht?

Habe aber nun schon das nächste Problem.
Mit folgenden Homematic Skript soll laut Tobias nun die Telefonnummer in die Datei "rufumleitung.txt" in meinen DoorPi geschrieben werden:

Code: Alles auswählen

dom.GetObject("CUxD.CUX2801010:1.CMD_EXEC").State("echo +49171XXXX | ssh pi@192.168.1.36 'cat > /usr/local/etc/DoorPi/rufumleitung.txt'");
Leider funktioniert das bei mir nicht.
Ich gehe auf "Skript testen", gebe diese Zeile ein aber nichts passiert, auch die Ausgabe bleibt leer.
Zentrale: Charly RaspberryMatic (Pi4), Gateway: Raspberry Pi3 HM-MOD-RPI-PCB, 3 Stück Funk-Schaltaktor, 4-fach, 2 Stück Funk-Rollladenaktor für Markenschalter, 1 Stück 8-Kanal-Sendemodul, 1 Stück E-Paper-Display, 2 Stück Funk-Tür-/Fensterkontakt, WinMatic, 2 Stück Heizkörperthermostat HmIP-eTRV-2, Wandthermostat HmIP-WTH-2, weiterer Ausbau nach und nach geplant.

Bahni
Beiträge: 234
Registriert: 15.01.2011, 14:40
System: CCU und Access Point
Wohnort: Waldheim / Sachsen
Hat sich bedankt: 25 Mal

Re: Raspberrymatic Passwortloser SSH-Zugriff auf DoorPi

Beitrag von Bahni » 01.01.2019, 09:42

Ich wünsche allen ein gutes und gesundes 2019.
Habe es nun hinbekommen, es musste noch im CUx-Daemon ein Gerät (System) siehe hier https://www.christian-luetgens.de/homem ... lation.htm hinzugefügt werden.
Jetzt klappt alles.
Danke.
Zentrale: Charly RaspberryMatic (Pi4), Gateway: Raspberry Pi3 HM-MOD-RPI-PCB, 3 Stück Funk-Schaltaktor, 4-fach, 2 Stück Funk-Rollladenaktor für Markenschalter, 1 Stück 8-Kanal-Sendemodul, 1 Stück E-Paper-Display, 2 Stück Funk-Tür-/Fensterkontakt, WinMatic, 2 Stück Heizkörperthermostat HmIP-eTRV-2, Wandthermostat HmIP-WTH-2, weiterer Ausbau nach und nach geplant.

dtp
Beiträge: 10658
Registriert: 21.09.2012, 08:09
System: CCU
Wohnort: Stuttgart
Hat sich bedankt: 320 Mal
Danksagung erhalten: 501 Mal

Re: Raspberrymatic Passwortloser SSH-Zugriff auf DoorPi

Beitrag von dtp » 01.01.2019, 12:20

Freut mich, dass es nun klappt.

Was den System.Exec-Befehl über CUxD angeht, so war ich da wohl etwas zu voreilig in der Annahme, dass der Hinweis auf CUxD im HM-Skript automatisch die bereits vorhandene Installation einen entsprechenden Geräts bedingen würde. Ich hab's aber nun in meiner DoorPi-Anleitung an entsprechender Stelle ergänzt. Sorry für die Verwirrung.

Gruß,

Thorsten
CCU3 mit stets aktueller FW und den Addons "CUxD" und "Programmedrucken", ioBroker auf Synology DiskStation DS718+ im Docker-Container;
einige Projekte: zentrales Push-Nachrichten-Programm zPNP, DoorPi-Videotürsprechanlage, An- und Abwesenheitsdetektion per Haustürschloss, zentrales Programm zur Steuerung von Beschattungsgeräten zBSP.

Benutzeravatar
GoSh
Beiträge: 62
Registriert: 30.09.2019, 19:45
System: Alternative CCU (auf Basis OCCU)
Hat sich bedankt: 15 Mal
Danksagung erhalten: 3 Mal

Re: Raspberrymatic Passwortloser SSH-Zugriff auf DoorPi

Beitrag von GoSh » 18.01.2022, 14:55

Bahni hat geschrieben:
31.12.2018, 16:52
Das "ssh-keygen" zum generieren eines Schlüssels da ist ist klar.
Aber warum gehts mit "ssh-keygen -b -t rsa" nicht?
Der Chat ist zwar schon älter und gelöst. Ich Knabber aktuell an fast dem gleichen Problem bei einem SSH-Connect auf einen Switch. M.W. sollte man inzwischen nur noch Keys für "SSH protocol version 2" generieren. Siehe : viewtopic.php?f=65&t=70283&p=684726&hil ... ec#p684738

Die Antwort zur o.g. Frage findet sich m.E. hier : https://linux.die.net/man/1/ssh-keygen
"ssh-keygen can create RSA keys for use by SSH protocol version 1 and RSA or DSA keys for use by SSH protocol version 2. The type of key to be generated is specified with the -t option. If invoked without any arguments, ssh-keygen will generate an RSA key for use in SSH protocol 2 connections."

Antworten

Zurück zu „RaspberryMatic“