SSH Passwort zurücksetzen

Community-Firmware (cfw), Selbstbaucontroller (TX-Pi, ftduino, usw.), usw.
Forumsregeln
Bitte beachte die Forumsregeln!
Antworten
XyBrot
Beiträge: 5
Registriert: 30 Jun 2020, 17:12

SSH Passwort zurücksetzen

Beitrag von XyBrot » 29 Nov 2020, 20:02

Hallo miteinander,

Ich besitze mehrere TXT Controller, auf welchen ich die cfw auf den SD Karten boote.
Ich greife für gewöhnlich auf meine TXTs via SSH zu und starte so meine Apps. Um nicht jedes mal den Zugriff per Touch bestätigen zu müssen, habe ich das Passwort des ftc users geändert.

Nun habe ich folgendes Problem: Meine Passwörter für ftc und root funktionieren plötzlich auf einem meiner TXTs nicht mehr. Ich habe sie jedoch nicht geändert.

Ich habe die 3 Dateien zum Booten der cfw auf der SD Karte bereits gelöscht und neu draufgespielt. Kein Ergebnis.

Hat jemand schon ähnliches erlebt und kann mir weiterhelfen?

Schon mal vorab vielen Dank.

Petabytemax
Beiträge: 18
Registriert: 06 Dez 2020, 22:34

Re: Reset SSH password

Beitrag von Petabytemax » 06 Dez 2020, 22:56

Hallo ja, ich bin auch ein TX-Pi-Hut-Benutzer, habe einen Himbeer-Pi 3b, auf dem das bereitgestellte Image ausgeführt wird, und SSH funktioniert bei mir nicht.

Normalerweise schreibt man mit einem Pi eine kleine Datei (keine Erweiterung) namens "SSH" auf das Bootdrive der microSD-Karte, und dann liest der Pi OS sie, benennt sie um und aktiviert ssh. Ich habe dies mit dem Pi und dem Raspberry pi OS getestet und es ist in Ordnung, aber dies scheint nicht für die Community-Firmware zu funktionieren und ob ich den SSH in der Konfigurations- / Einstellungs-App einschalte oder nicht, es bleibt unzugänglich.

google translated from the following
Hi yes, im a TX-pi hat user as well, have a raspberry pi 3b running the provided Image and SSH is not working for me.

typically with a pi one would write a small file ( no extension) called "SSH" to the bootdrive of the microSD card and then the pi os would read it, rename it and enable ssh. I've tested this with the Pi and the Raspberry pi OS and its fine but this doesn't seem to work for the community firmware and whether i turn on the SSH or not in the Configuration/Setting app it remains inaccessible.

Benutzeravatar
MasterOfGizmo
Beiträge: 2720
Registriert: 30 Nov 2014, 07:44

Re: SSH Passwort zurücksetzen

Beitrag von MasterOfGizmo » 07 Dez 2020, 08:04

Diese beiden Fragen haben wenig miteinander zu tun. Der OP bezieht sich auf die Community-Firmware für den fischertechnik-TXT-Controller. Die zweite Frage bezieht sich auf den TX-Pi (der HAT ist prima, hat aber mit diesem Problem hier nichts zu tun).

Zur ersten Frage: Wenn Du die Karte komplett löscht, dann gehen auch alle EInstellungen verloren und die Passwörter sollten auch verschwinden. Formatiere die Karte ggf. mal. M.E. legt die Community-Firmware zusätzliche Partitionen an, die Du unter Windows nicht siehst, die aber da sind und Daten enthalten.

Zur zweiten Frage: M.E. ist in den Fertig-Images SSH bereits ab Werk aktiviert. Funktionoiert denn die Netzwerkverbindung? Ich nehme an, dass Du es über Ethernet versuchst. Bekommt Dein PI eine IP-Adresse? Wir die in der Benutzeroberfläche angezeigt? Gehen andere Dienste wie z.B. der Webserver?
Arduino für fischertechnik: ftDuino http://ftduino.de, ftDuino32 http://ftduino.de/32

Petabytemax
Beiträge: 18
Registriert: 06 Dez 2020, 22:34

Re: Reset SSH password

Beitrag von Petabytemax » 07 Dez 2020, 23:31

thanks for your reply,
as you suggest SSH should already be activated
it is is shown ticked in the system config services menu
However on attempted access, it doesn't accept my connection
and throws an error that I don't get when trying to SSH into other raspberry pi's

using the standard fresh image from the tx-pi website, I setup wifi which works for VNC and Web access just not ssh.
the IP address can be read from the screen bar at the top or the network app in system
this applies whether i use ethernet rj45 or wifi
Zuletzt geändert von Petabytemax am 09 Dez 2020, 01:22, insgesamt 3-mal geändert.

Benutzeravatar
MasterOfGizmo
Beiträge: 2720
Registriert: 30 Nov 2014, 07:44

Re: SSH Passwort zurücksetzen

Beitrag von MasterOfGizmo » 08 Dez 2020, 16:43

Uhm ... What error messages do you get?
Arduino für fischertechnik: ftDuino http://ftduino.de, ftDuino32 http://ftduino.de/32

Petabytemax
Beiträge: 18
Registriert: 06 Dez 2020, 22:34

Re: Reset SSH password

Beitrag von Petabytemax » 09 Dez 2020, 01:20

using an ssh client i try to connect to this ip on port 22 and get an error message

Network error: Software caused connection abort

i read on some TXT related page that the TXT only lets you access ssh after accepting the request on the screen of the txt, but i see no such request
i have tries setting the username but if i use vnc and the terminal program i cant seem to add a password for root or change the password for user FTC

unsure where its clearly explained but it seems their may be 3 users on the TX-pi Community firmware images

USER password
1 ftc none
2 root ???? may be disabled
3 ROBOpro ROBOpro - but unused

Benutzeravatar
MasterOfGizmo
Beiträge: 2720
Registriert: 30 Nov 2014, 07:44

Re: SSH Passwort zurücksetzen

Beitrag von MasterOfGizmo » 09 Dez 2020, 17:47

This error message seems to be the universal "there is a problem" message of putty. You are using Putty and a windows PC, right?

One problem would e.g. arrive if you previously had a different linux installation on that pi and already connected that from this putty/pc before. Now putty recognizes by the Pi's mac address that it's a known device but since the new installation uses newly generated crypto keys the secure connection fails.

Do you happen to have a second PC with a SSH client? Can you connect from that one?

Regarding the users: On the TX-Pi there inho shouldn't be a RoboPro user. This exists in the community firmware on the TXT controller to maintain some compatibility. But on the TX-Pi there should imho only be ftc, the regular 'pi' user and root. The ftc user can log in with pw ftc and the pi user has the usual raspberry pw. Only the pi user has unlimited access to sudo and thus to root permissions.

The root user is not "disabled" but it isn't allows to log in. That's common with unix' today to have an additional layer of security. You need to log in as a regular pi user and then you can use sudo. Like any other pi.
Arduino für fischertechnik: ftDuino http://ftduino.de, ftDuino32 http://ftduino.de/32

Petabytemax
Beiträge: 18
Registriert: 06 Dez 2020, 22:34

Re: Reset SSH password

Beitrag von Petabytemax » 11 Dez 2020, 16:33

Hi Master

Thanks for your explanation and although I agree the error message can be a common one ( often cache related) I feel their maybe something else more complex going on here

you're right that I'm using a Windows PC but I'm using an app called MobaXterm instead which can integrate VNC and other ways to access remote devices.

as you suggested I have tried another PC with SSH and also Android phone using the Raspcontroller app
This is what I'm finding

A. Tx-Pi SSH Server turned off (deselecting the tick box in system config)
on connection to local lan 192.168.0.113
I see the error :- "unreachable host"

B. Tx-Pi SSH Server turned on (SSH tick box selected in system config)
on connection to local lan 192.168.0.113 using pi username leaving password blank
I see the error :- "broken transport encountered EOF"

B. Tx-Pi SSH Server turned on (SSH tick box selected in system config)
on connection to local lan 192.168.0.113 use the pi username password raspberry
I see the error :- "broken transport encountered EOF"

what I should see unless I have the correct credentials is "Authentication failed, invalid username and password"

the image worked ok, I had no download errors,
the MD5 checksum looks correct = MD5 hash of tx-pi_20.1_RPi3_WS35A.img:2eade355f5444abbccf57cdc50089922

have written it twice to the card, Anything else to try ?

Petabytemax
Beiträge: 18
Registriert: 06 Dez 2020, 22:34

Re: Reset SSH password

Beitrag von Petabytemax » 14 Dez 2020, 14:43

Weitere Informationen hier - SSH wurde bei der manuellen Installation von behoben.

Verwenden der verfügbaren Images Der SSH-Zugriff scheint nicht ordnungsgemäß zu funktionieren, unabhängig von seinem Status in Raspi-config, den txpi-Systemkonfigurationsdiensten oder der "ssh" -Datei in der Startpartition
Es funktioniert jedoch nach einer manuellen Installation mit dem Rasbian Buster Lite-Image und dem Ausführen des Installationsskripts.

Dies wirft die Frage auf, ob es andere Unterschiede bei der Verwendung des Bildes gibt.

Ich bin jedoch mit der obigen Problemumgehung zufrieden, obwohl ich noch 2 Fragen habe, bevor ich meinem kleinen Sohn TX-PI wie vorgesehen als Weihnachtsgeschenk geben kann!

1. Sollten wir das System "APT" verwenden, um die RPI-Pakete zu aktualisieren und dann zu aktualisieren (gemäß der bewährten RPI-Praxis?)
2. Findet jemand, dass die Waveshare-Bildschirme nach einer Weile nicht mehr auf Berührungen reagieren, wenn der TX-Pi-Hut angebracht ist?

More info here - SSH is fixed when manually installing

using the available images SSH access doesn't seem to work correctly, independent of its status in Raspi-config, txpi system config services or the "ssh" file in the boot partition
However it works after a manual install using the rasbian buster lite image and running the install script.

this raises a question about if their are any other differences when using the image ?

however am happy with the workaround above though 2 remaining questions before I can give TX-PI as intended to my young son as his xmas present !

1. Should we use the System, "APT" program to update and then upgrade the RPI's packages ( as per rpi good practice ?)
2. does anyone find the waveshare screens stop responding to touch after a while when the tx-pi hat is attached ?

XyBrot
Beiträge: 5
Registriert: 30 Jun 2020, 17:12

Re: SSH Passwort zurücksetzen

Beitrag von XyBrot » 15 Dez 2020, 15:39

MasterOfGizmo hat geschrieben:
07 Dez 2020, 08:04
Diese beiden Fragen haben wenig miteinander zu tun. Der OP bezieht sich auf die Community-Firmware für den fischertechnik-TXT-Controller. Die zweite Frage bezieht sich auf den TX-Pi (der HAT ist prima, hat aber mit diesem Problem hier nichts zu tun).

Zur ersten Frage: Wenn Du die Karte komplett löscht, dann gehen auch alle EInstellungen verloren und die Passwörter sollten auch verschwinden. Formatiere die Karte ggf. mal. M.E. legt die Community-Firmware zusätzliche Partitionen an, die Du unter Windows nicht siehst, die aber da sind und Daten enthalten.

Zur zweiten Frage: M.E. ist in den Fertig-Images SSH bereits ab Werk aktiviert. Funktionoiert denn die Netzwerkverbindung? Ich nehme an, dass Du es über Ethernet versuchst. Bekommt Dein PI eine IP-Adresse? Wir die in der Benutzeroberfläche angezeigt? Gehen andere Dienste wie z.B. der Webserver?
Erst mal Danke für die Antwort. Eine Formatierung habe ich bereits versucht und hat leider zu keinem Ergebnis geführt. Das SSH-Passwort wird dabei scheinbar nicht zurückgesetzt. Gibt es eine Möglichkeit dieses anders zurückzusetzten?
Ist es möglich, dass die Daten gar nicht auf der SD-Karte sondern irgendwo auf dem TXT gespeichert sind? Weil selbst Wlan Einstellungen und Programme bleiben nach der Formatierung der SD-Karte erhalten.

Petabytemax
Beiträge: 18
Registriert: 06 Dez 2020, 22:34

Re: Reset SSH password

Beitrag von Petabytemax » 16 Dez 2020, 12:51

How to fix SSH access if its is broken on the TxPi Image

logon to the console ( either directly via a hdmi screen and keyboard or via VNC)

SU Switch User to an user with admin rights ( FTC user doesn't have root access)

check the status of SSH using

Code: Alles auswählen

sudo service ssh status
you will probably see something like

Code: Alles auswählen

ssh.service - OpenBSD Secure Shell server
   Loaded: loaded (/lib/systemd/system/ssh.service; 
   Active: active (running) since Wed 2020-12-16 11:
     Docs: man:sshd(8)
           man:sshd_config(5)
  Process: 792 ExecStartPre=/usr/sbin/sshd -t (code=
 Main PID: 799 (sshd)
    Tasks: 1 (limit: 2200)
   Memory: 2.1M
   CGroup: /system.slice/ssh.service
           ââ799 /usr/sbin/sshd -D

Dec 16 11:55:37 tx-pi sshd[973]: error: Could not load host key: /etc/ssh/ssh_host_rsa_key
Dec 16 11:55:37 tx-pi sshd[973]: fatal: No supported
Dec 16 11:55:58 tx-pi sshd[983]: error: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Dec 16 11:55:58 tx-pi sshd[983]: error: Could not load host key: /etc/ssh/ssh_host_ed25519_key

...skipping...
showing the SSH deamon cannot load the key file
so run

Code: Alles auswählen

sudo ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
sudo ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key
sudo ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key
which recreates the key files and then check if they are now visable with

Code: Alles auswählen

LS -al /etc/ssh
now check and you should find you can connect VIA SSH !!

I found this info on the LCD wiki at http://www.lcdwiki.com/res/PublicFile/R ... ect_EN.pdf

tintenfisch
Beiträge: 472
Registriert: 03 Jan 2018, 22:04

Re: SSH Passwort zurücksetzen

Beitrag von tintenfisch » 25 Dez 2020, 14:23

Thanks for your research. I can confirm the problem, at least with the Pi3 / 3.5" A card image.

We opened an issue for it and we'll try to fix it: https://github.com/ftCommunity/tx-pi/issues/61

Best regards,
Lars

Antworten