On the Linux laptop I had SSH passwordless login by SSH key pair and everything was fine for a long time. But the laptop’s batteries were bloated so I had to change them, so BIOS settings erased, so Windoof booted, Win** found unexpected file system, started unasked to ‘fix’ it and so destroyed my Linux kernel.
…
Now I have a new Linux installation (and a new battery), but now ssh login on the SFOS phone is no more possible:
andrea@andrea-Voom-Laptop-Max:~$ ssh x10
ssh: connect to host 192.168.0.4 port 22: Connection refused
andrea@andrea-Voom-Laptop-Max:~$ ssh defaultuser@192.168.0.4
ssh: connect to host 192.168.0.4 port 22: Connection refused
andrea@andrea-Voom-Laptop-Max:~$
Neither passwordless nor ‘old style’ by username and password.
How can I - on the phone as devel-su - delete all SSH key pair stuff to become able to install it new?
There seems to be many assumptions here, and missing information.
Do you still have the required private keys (those not ending in .pub) on your laptop? And everything in ~/.ssh basically?
Have you configured sshd on your phone to allow only specific IPs/users or anything like that?
Is your phone completely untouched by the recent laptop desaster?
Why would you want to do that?
Anyhow: No devel-su required. Just cd ~/.ssh and delete what you want there.
That doesn’t look like key issues, it looks like wrong IP - like another device with no ssh sever.
Run ssh with -v and see what is really going on before guessing on remedies.
Once in a blue moon i need to reboot my phone or router for odd breakages like this. But i assume you have done basics like that before asking?
@ohnonot Content of ~/.ssh/* of the old crashed Linux is still available including the old keys (pub and private), also config. (Did install the new Linux onto a new SSD and kept the old one in the drawer)
@attah IP addresses are the same as before and manually set from a paper list in my documentation. Also the ~/.ssh/config is copied from the old crashed system. The ssh keys for one Xperia10 and the Volla are generated new and working fine. But the new generated ssh key and also the ‘normal’ login for the other Xperia 10 don’t work.
This is the error message when trying to ssh to the X10 using -v modifier:
andrea@andrea-Voom-Laptop-Max:~$ ssh -v defaultuser@192.168.0.4
OpenSSH_8.9p1 Ubuntu-3ubuntu0.3, OpenSSL 3.0.2 15 Mar 2022
debug1: Reading configuration data /home/andrea/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to 192.168.0.4 [192.168.0.4] port 22.
debug1: connect to address 192.168.0.4 port 22: Connection refused
ssh: connect to host 192.168.0.4 port 22: Connection refused
andrea@andrea-Voom-Laptop-Max:~$
With the key files from the old Linux copied to the new system it also doesn’t work.
Are you sure, you haven’t changed ssh configuration on your phone? Another reason for not being able to connect would be, that your sshd is listening on a different port
I didn’t change anything on the phone. It was the laptop that crashed, so there the Linux is fresh installed from zero onto a new SSD. While I did so, the phone was unused and untouched, and after this the login to to THIS phone doesn’t work any more but login to 2 other SFOS phones does work fine again.
andrea@andrea-Voom-Laptop-Max:~$ arp -n
Adresse Hardware-Typ Hardware-Adresse Optionen Maske Schnittstelle
192.168.0.1 ether (address) C enxc84d442109a4
192.168.0.2 ether (address) C enxc84d442109a4
192.168.0.4 ether 70:a6:cc:53:d2:6b C enxc84d442109a4
andrea@andrea-Voom-Laptop-Max:~$
The ‘4’ is the phone that doesn’t work.
andrea@andrea-Voom-Laptop-Max:~$ nmap -Pn -p 22 -n 192.168.0.4
Starting Nmap 7.94 ( https://nmap.org ) at 2023-09-07 19:05 WEST
Nmap scan report for 192.168.0.4
Host is up (0.043s latency).
PORT STATE SERVICE
22/tcp closed ssh
Nmap done: 1 IP address (1 host up) scanned in 0.11 seconds
andrea@andrea-Voom-Laptop-Max:~$
That might be correct. I see “filtered” for X very often when it is not filtered. Guess that is because of the wake process. netstat on the phone. Guess you won’t see port 22 on the list, so, sshd then would be down down…
Anyway, with the port closed, you get “connection refused” and as was said before, “keys” didn’t even come into the game…
@attah Yes it’s the same problem as 2 years ago. Now I also tried all suggestions from this time but now it doesn’t help. Some hidden detail must be different but I don’t know what.
edit: From another laptop ssh connection is also not possible. The phone doesn’t listen on port 22, and I have no idea what I can do now. Port 22: connection refused.
If a firewall defaults to DROP you will see ‘filtered’. If it does a REJECT or there is no firewall (and nothing listening on the port), it will show ‘closed’.
Don’t think so.
If I ran the command several times as posted above, I get “open” and “host down”. If I add –disable-arp-ping I get “open” and “filtered”. I don’t think that firewall rules are touched by “sleep” and “wake up”, they are much too slow for that. So, I think this happens during “sleep transition”. But this is academic for the original problem…
I use Ubuntu 22.04 Jammy Jellyfish (x86-64) / Cinnamon 5.2.7 on a 2 year old laptop named ‘InnJoo’.
edit: In my network settings (the same icon on the dock as on your system), there are no settings regarding other LAN or WAN hosts, but only the network adapter settings. IP-Address, subnet mask, gateway, DNS, routes, proxies… nothing else, no other hosts there at my computer. In this setting dialog it’s also possible to install a VPN connection and a lot of other connection types, but currently not in use at the moment on my computer.
edit: nothing else is wrong, there’s a lot, but I didn’t fill in anything there, the defaults work. But I could really find nothing regarding other hosts in the LAN, e.g. Xperia.
Sometimes sshserver stops on my phone although ssh connection is enabled in settings, then i get the same error you got. Then i usually deactivate ssh connection and then enable it again and then i can connect