Seite 2 von 2

Re: Raspberrymatic Passwortloser SSH-Zugriff auf DoorPi

Verfasst: 31.12.2018, 13:44
von Bahni

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:

Re: Raspberrymatic Passwortloser SSH-Zugriff auf DoorPi

Verfasst: 31.12.2018, 15:16
von hoedlmoser
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/

Re: Raspberrymatic Passwortloser SSH-Zugriff auf DoorPi

Verfasst: 31.12.2018, 16:18
von Bahni
Habe jetzt "ssh-keygen" ohne Parameter eingeben und siehe da es funktioniert.
Gibt es dafür nun einen Grund?

Re: Raspberrymatic Passwortloser SSH-Zugriff auf DoorPi

Verfasst: 31.12.2018, 16:31
von TAOG
ja klar.
ssh-keygen ist zum generieren eines Schlüssels.
ssh ist der ausführende Befehl...

Re: Raspberrymatic Passwortloser SSH-Zugriff auf DoorPi

Verfasst: 31.12.2018, 16:52
von Bahni
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.

Re: Raspberrymatic Passwortloser SSH-Zugriff auf DoorPi

Verfasst: 01.01.2019, 09:42
von Bahni
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.

Re: Raspberrymatic Passwortloser SSH-Zugriff auf DoorPi

Verfasst: 01.01.2019, 12:20
von dtp
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

Re: Raspberrymatic Passwortloser SSH-Zugriff auf DoorPi

Verfasst: 18.01.2022, 14:55
von GoSh
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."