SSH + SFTP access to phone lost

Ah, you figured it out… -v is nothing on its own.
That was the next reasonable step… so something about the dns has gone out of sync.

I suggest permanenting the device ip in your router, so then this will never happen. And while you are at it, reboot the router.

Edit: my bad - it still isn’t working… then i’m probably out of ideas with that reboot.
Well, maybe check the journal log on the phone while failing to ssh to it.

1 Like

The IP addresses on LAN are static, anyhow I will reboot the router (which is another Xperia 10) and then report. Btw, the ssh connection to this ‘router phone’ always worked from the laptop and from the ‘other’ X10. Only the Volla doesn’t accept connections coming from laptop or other X10, says always:

debug1: connect to address 192.168.0.3 port 22: Connection refused
ssh: connect to host 192.168.0.3 port 22: Connection refused

edit: Tomorrow I’ll try to delete all keys for the passwordless login and then and re-establish. I strongly suspect that something there is broken. It worked for months, until today afternoon, an hour later without any reason it suddenly failed. All the rest still works fine on the Volla. Strange…

No need to do that yet, “connection refused” is quite clear (and happens on a layer below ssh): the phone is refusing connections on port 22 - sshd config does not come into play here yet.

Either sshd is not running (is Developer mode enabled, and the “allow remote connections” switch checked, does netstat -lpn | grep 22 show sshd listening?
Or the phone firewall does not allow port 22.
Or the router does not allow forwarding to port 22 (can you ping the phone??).

1 Like

Just in case, in settings -> developper mode: Is remote connection item selected?

1 Like

And usually, i use: ssh -l defaultuser 192.168.0.3

1 Like

Thank you very much, this worked on the first try! I did nothing else than connect the Volla with LAN and execute this command.
My good old ssh volla using an entry in ~/.ssh/config also works again.
Accessing the Volla by Linux GUI also works again.
The Volla is up and running again. Thank you very much, @phklrz !

Thank you much @nephros , meanwhile it runs again, so I could do your suggested check in a comfortably way on the laptop screen. Result is:

andrea@andrea-Voom-Laptop-Max:~$ ssh volla
Last login: Mon Apr 24 11:02:52 2023 from 192.168.0.25
,---
| Sailfish OS 4.5.0.19 (Struven ketju)
'---
[defaultuser@VollaPhone ~]$ devel-su
Password: 
[root@VollaPhone defaultuser]# netstat -lpn | grep 22
tcp        0      0 :::22                       :::*                        LISTEN      1/systemd           
unix  2      [ ACC ]     STREAM     LISTENING     54336  2393/xdg-dbus-proxy /run/firejail/dbus/100000/2295-user
unix  2      [ ACC ]     STREAM     LISTENING     54338  2393/xdg-dbus-proxy /run/firejail/dbus/100000/2295-system
unix  2      [ ACC ]     STREAM     LISTENING     53322  2326/booster-browse /run/user/100000/mapplauncherd/_sailfish-browser/browser/socket
unix  2      [ ACC ]     STREAM     LISTENING     47567  1822/pulseaudio     /run/user/100000/pulse/dbus-socket
unix  2      [ ACC ]     STREAM     LISTENING     46313  1822/pulseaudio     /run/user/100000/pulse/native
[root@VollaPhone defaultuser]# 

So evertthing found with this command seems now to be up and running and listening as it should. And from normal user sight the phone works again as it should. Again many thanks, @nephros !

…and you can persist that in the user config so you never need to think about it again:

~/.ssh/config/

host jolla jollatab gemini
    user nemo
host xperia10 xperiiia10 xperiaxc
    user defaultuser
host laptop workstation
    user nephros
host 10.0.0.55
  IdentityFile ~/.ssh/id_backup_nopass
  IdentitiesOnly yes
host github.com
  user git
  IdentityFile ~/.ssh/id_github
  IdentitiesOnly yes

Again the same problem, this time on Xperia 10 SFOS 4.6.0.13, freshly flashed. Storeman, Chum and File Browser installed and nothing else and no tweaks or other tinkering. Phone was very restive at trying to set it to a fixed IP on my WLAN, but in the end it seems to work.
Phone permanently says:

andrea@AndreaDesktop:~$ ssh defaultuser@192.168.0.3
ssh: connect to host 192.168.0.3 port 22: Connection refused
andrea@AndreaDesktop:~$ 

Nothing from above in this thread helps.
Can I delete some file on the phone so that it doesn’t remember old failed login attempts?

ssh: connect to host 192.168.0.3 port 22: Connection refused

This means that nothing is listening on port 22 at least on the external interface.
This is the output of a quick check on my device:

[root@xperia ~]# systemctl status sshd.socket
● sshd.socket - OpenSSH Server Socket
   Loaded: loaded (/usr/lib/systemd/system/sshd.socket; enabled; vendor preset: enabled)
   Active: active (listening) since Tue 2024-09-10 17:24:32 CEST; 2 days ago
   Listen: [::]:22 (Stream)
 Accepted: 455; Connected: 1
   CGroup: /system.slice/sshd.socket

Is ssh installed (check with rpm -q openssh-server)? Is the sshd socket enabled?

SFTP also fails because “authentication too often failed”
ssh displays this:

andrea@AndreaDesktop:~$ ssh exp
Received disconnect from 192.168.0.3 port 22:2: Too many authentication failures
Disconnected from 192.168.0.3 port 22
andrea@AndreaDesktop:~$ 

How can I reset the authentication failure counter?

AKAIK ssh doesn’t store something like this. The second answer in this thread might have the right hint. If not, ‘ssh -v exp’ will provide additional information.

Thank you so much @martinh !
$ ssh-copy-id -i /home/andrea/.ssh/exp_rsa.pub -p 22 -o PubkeyAuthentication=no defaultuser@192.168.0.3
unblocked it after entering password. SFTP also working now. :star_struck: