SSH: no route to host

What type of hardware are you using: Old laptop or computer
What YunoHost version are you running: 12.0
How are you able to access your server: The webadmin
Direct access via physical keyboard/screen
Are you in a special context or did you perform specific tweaking on your YunoHost instance ?: No

Describe your issue

Hello everybody,
Yesterday I installed Yunohost 12.0 / Nextcloud on a Dell Latitude E6540. All this stuff is behind a BBox Miami fiber box by an Ethernet wired connexion.
Then, early this morning before I went to bed everything worked perfectly and all my clients were synchronized and I can access to Nextcloud from the outside. Before sleeping, I left one of my laptop connected to the server throughout SSH.
A few hours later at my wake, I just wanted to remove some temp folder I created on the server but I remarked that my SSH session couldn’t be established again:

$ ssh pascal@192.168.1.58 ssh: connect to host 192.168.1.58 port 22: No route to host $ ssh 192.168.1.58 ssh: connect to host 192.168.1.58 port 22: No route to host
So, I tried to ping the server:

$ ping 192.168.1.58 PING 192.168.1.58 (192.168.1.58) 56(84) bytes of data. From 192.168.1.182 icmp_seq=1 Destination Host Unreachable
So, I restarted all my stuff: my client laptop, the server, the BBox. Same thing: SSH is unreachable.
Then, I tried to use another ethernet port: same thing
However, if I try in the reverse way (connect to my client laptop from the server) it’s working.
I can’t understand, I did nothing during my sleep :smiley:
I found nothing relevant neither in logs nor in Failtoban.
So what’s wrong ?
Could you help me please ?
Thanks a lot in advance,
Pascal

Share relevant logs or error messages

args:
key: security
value: null
ended_at: 2025-05-01 08:17:32.503552
error: null
interface: api
operation: settings_set
parent: null
related_to:
started_at: 2025-05-01 08:17:32.061387
success: true
yunohost_version: 12.0.14

============

2025-05-01 10:17:32,070: DEBUG - Nothing to update in LDAP
2025-05-01 10:17:32,070: INFO - Saving the new configuration

2025-05-01 10:17:32,090: DEBUG - Formating result in ‘export’ mode
2025-05-01 10:17:32,094: DEBUG - Executing command ‘[‘sh’, ‘-c’, ‘/bin/bash -x “./03-ssh” pre '' '' /var/cache/yunohost/regenconf/pending/ssh 7>&1’]’
2025-05-01 10:17:32,097: DEBUG - + set -e
2025-05-01 10:17:32,098: DEBUG - + . /usr/share/yunohost/helpers
2025-05-01 10:17:32,098: DEBUG - ++++ dirname – /usr/share/yunohost/helpers
2025-05-01 10:17:32,099: DEBUG - +++ cd – /usr/share/yunohost
2025-05-01 10:17:32,099: DEBUG - +++ pwd
2025-05-01 10:17:32,100: DEBUG - ++ SCRIPT_DIR=/usr/share/yunohost
2025-05-01 10:17:32,100: DEBUG - ++ YNH_HELPERS_VERSION=1
2025-05-01 10:17:32,101: DEBUG - ++ readonly ‘XTRACE_ENABLE=set -o xtrace’
2025-05-01 10:17:32,101: DEBUG - ++ XTRACE_ENABLE=‘set -o xtrace’
2025-05-01 10:17:32,128: DEBUG - + do_pre_regen /var/cache/yunohost/regenconf/pending/ssh
2025-05-01 10:17:32,129: DEBUG - + pending_dir=/var/cache/yunohost/regenconf/pending/ssh
2025-05-01 10:17:32,129: DEBUG - + cd /usr/share/yunohost/conf/ssh
2025-05-01 10:17:32,164: DEBUG - + export compatibility=intermediate
2025-05-01 10:17:32,164: DEBUG - + compatibility=intermediate
2025-05-01 10:17:32,197: DEBUG - + export port=22
2025-05-01 10:17:32,198: DEBUG - + port=22
2025-05-01 10:17:32,198: DEBUG - ++ int_to_bool
2025-05-01 10:17:32,198: DEBUG - ++ sed -e ‘s/^1$/True/g’ -e ‘s/^0$/False/g’ -e ‘s/^true$/True/g’ -e ‘s/^false$/False/g’
2025-05-01 10:17:32,231: DEBUG - + export password_authentication=True
2025-05-01 10:17:32,231: DEBUG - + password_authentication=True
2025-05-01 10:17:32,232: DEBUG - ++ ls /etc/ssh/ssh_host_ed25519_key /etc/ssh/ssh_host_rsa_key /etc/ssh/ssh_host_ecdsa_key
2025-05-01 10:17:32,233: DEBUG - + export ‘ssh_keys=/etc/ssh/ssh_host_ecdsa_key
2025-05-01 10:17:32,233: DEBUG - /etc/ssh/ssh_host_ed25519_key
2025-05-01 10:17:32,233: DEBUG - /etc/ssh/ssh_host_rsa_key’
2025-05-01 10:17:32,234: DEBUG - + ssh_keys=‘/etc/ssh/ssh_host_ecdsa_key
2025-05-01 10:17:32,234: DEBUG - /etc/ssh/ssh_host_ed25519_key
2025-05-01 10:17:32,234: DEBUG - /etc/ssh/ssh_host_rsa_key’
2025-05-01 10:17:32,234: DEBUG - + [[ -f /proc/net/if_inet6 ]]
2025-05-01 10:17:32,234: DEBUG - + ipv6_enabled=true
2025-05-01 10:17:32,234: DEBUG - + export ipv6_enabled
2025-05-01 10:17:32,234: DEBUG - + ynh_render_template sshd_config /var/cache/yunohost/regenconf/pending/ssh/etc/ssh/sshd_config
2025-05-01 10:17:32,234: DEBUG - + local template_path=sshd_config
2025-05-01 10:17:32,234: DEBUG - + local output_path=/var/cache/yunohost/regenconf/pending/ssh/etc/ssh/sshd_config
2025-05-01 10:17:32,234: DEBUG - ++ dirname /var/cache/yunohost/regenconf/pending/ssh/etc/ssh/sshd_config
2025-05-01 10:17:32,235: DEBUG - + mkdir -p /var/cache/yunohost/regenconf/pending/ssh/etc/ssh
2025-05-01 10:17:32,235: DEBUG - + python3 -c ‘import os, sys, jinja2; sys.stdout.write(
2025-05-01 10:17:32,236: DEBUG - jinja2.Template(sys.stdin.read()
2025-05-01 10:17:32,236: DEBUG - ).render(os.environ));’
2025-05-01 10:17:32,337: DEBUG - VĂ©rification de la configuration en attente qui aurait Ă©tĂ© appliquĂ©e pour la catĂ©gorie ‘ssh’

2025-05-01 10:17:32,345: DEBUG - processing pending conf ‘/var/cache/yunohost/regenconf/pending/ssh/etc/ssh/sshd_config’ to system conf ‘/etc/ssh/sshd_config’
2025-05-01 10:17:32,346: DEBUG - Le fichier de configuration ‘/etc/ssh/sshd_config’ a Ă©tĂ© sauvegardĂ© sous ‘/var/cache/yunohost/regenconf/backup/etc/ssh/sshd_config-20250501.081732’
2025-05-01 10:17:32,352: DEBUG - Le fichier de configuration ‘/etc/ssh/sshd_config’ a Ă©tĂ© mis Ă  jour
2025-05-01 10:17:32,352: SUCCESS - La configuration a Ă©tĂ© mise Ă  jour pour ‘ssh’
2025-05-01 10:17:32,354: DEBUG - updating conf hashes for ‘ssh’ with: {‘/etc/ssh/sshd_config’: ‘25ba62828712765d39b7e22713c2fe84’}
2025-05-01 10:17:32,367: DEBUG - Executing command ‘[‘sh’, ‘-c’, ‘/bin/bash -x “./03-ssh” post '' '' /etc/ssh/sshd_config 7>&1’]’
2025-05-01 10:17:32,370: DEBUG - + set -e
2025-05-01 10:17:32,370: DEBUG - + . /usr/share/yunohost/helpers
2025-05-01 10:17:32,371: DEBUG - ++++ dirname – /usr/share/yunohost/helpers
2025-05-01 10:17:32,371: DEBUG - +++ cd – /usr/share/yunohost
2025-05-01 10:17:32,372: DEBUG - +++ pwd
2025-05-01 10:17:32,372: DEBUG - ++ SCRIPT_DIR=/usr/share/yunohost
2025-05-01 10:17:32,372: DEBUG - ++ YNH_HELPERS_VERSION=1
2025-05-01 10:17:32,373: DEBUG - ++ readonly ‘XTRACE_ENABLE=set -o xtrace’
2025-05-01 10:17:32,374: DEBUG - ++ XTRACE_ENABLE=‘set -o xtrace’
2025-05-01 10:17:32,392: DEBUG - + do_post_regen /etc/ssh/sshd_config
2025-05-01 10:17:32,393: DEBUG - + regen_conf_files=/etc/ssh/sshd_config
2025-05-01 10:17:32,393: DEBUG - + [[ -n /etc/ssh/sshd_config ]]
2025-05-01 10:17:32,393: DEBUG - + chown root:root /etc/ssh/sshd_config
2025-05-01 10:17:32,394: DEBUG - + chmod 644 /etc/ssh/sshd_config
2025-05-01 10:17:32,395: DEBUG - + systemctl restart ssh
2025-05-01 10:17:32,497: DEBUG - Journal complet de cette opĂ©ration : ‘ RĂ©gĂ©nĂ©rer les configurations du systĂšme ‘ssh’ ’
2025-05-01 10:17:32,501: SUCCESS - Config updated as expected

And YNH server IP address is still 192.168.1.58?

Hello,
yes I can access to Yunohost on the same address by my web browser

As-tu la possibilité de tester depuis une connexion wifi et/ou depuis un autre appareil ?

Salut,
oui effectivement je n’ai pas pensĂ© Ă  le prĂ©ciser mais j’ai testĂ© d’accĂ©der en SSH depuis un autre PC mais j’ai le mĂȘme problĂšme.
Comme si le serveur n’avait plus son dĂ©mon SSH.
J’ai vĂ©rifiĂ© et il tourne.

Par contre tous les clients que j’ai essayĂ© sont connectĂ©s en wifi. Peut ĂȘtre devrais-je essayer un client connectĂ© en ethernet ?

Je viens d’essayer un client Android (en wifi): pareil


Mystérieux

Et le port 22 est toujours bien Ă  l’écoute sur le serveur ?
As-tu tenté nc -zv 192.168.1.58 22 ?
Ou modifié le port ssh / des params de sécurité dans la webadmin ?

Je viens d’essayer $ nc -zv 192.168.1.58 22 nc: connect to 192.168.1.58 port 22 (tcp) failed: No route to host
je n’ai absolument rien modifiĂ© entre hier et aujourd’hui.
J’ai redĂ©marrĂ© la box ce matin pensant que ça pouvait venir de là

Vraiment bizarre. Ce matin j’ai fait un systemctl status ssh sur le serveur mais je n’ai rien vu d’anormal

J’irai revĂ©rifier Ă  nouveau tout Ă  l’heure, et en mĂȘme temps je connecterai une machine cliente en ethernet

Dans la webadmin >tools >YunoHost settings : vérifie le numéro du port SSH.
Sinon dans la webadmin >tools >services, vérifie que le service SSH est en marche.
Le diagnostic peut aussi éclairer.

Bonjour,
je viens d’essayer avec une connexion ethernet: pareil.
Le port SSH n’a pas Ă©tĂ© modifiĂ© et est toujours 22.
Voici le log du service:

Je me demande pourquoi il n’y a que des ipv6 dans le log.
As-tu essayé ss -tuln | grep :22 ?

Non, je n’ai pas essayĂ© ss. CĂŽtĂ© serveur ?

Hi Pascal06,

Welcome to the forums!

My first hunch was fail2ban, but you already checked that.

As you installed Yunohost on a laptop (looking at images after searching for the model number), how about trying to SSH from the laptop itself?

Could you try connecting to 127.0.0.1 as well as 192.168.1.58, and see if either works or not? If localhost works, but the external IP not, could you post the output of `ssh -vv user@192.168.1.58’ ? (all of this from the server itself)

Can you connect via SSH from outside of your house, via the host/domain name or public IP?

Another thought: does the bbox provide a “http-only”-mode, that prevents access on any ports other than 80 and 443?

Hello,
thanks a lot for your reply.
I just tried to SSH from the server side:
ssh user@127.0.0.1 works
ssh user@192.168.1.58 don’t
Here the output of ssh -vv user@192.168.1.58


I tried to SSH the server from the outside by allowing port 22 on the BBox: it works. But I don’t want to be accessible on port 22 from the outside.
However I don’t know if the box provide a http only mode

Finally, following @otm33 here the output of ss -tuln | grep :22:

pascal@2plz:~$ ss -tuln | grep :22
tcp LISTEN 0 128    0.0.0:22    0.0.0.0:*
tcp LISTEN 0 128        [::]:22            [::]:*

Did you try to change the ssh port? On the webadmin >tools >YunoHost settings

Bonjour @Pascal06

Oui, sur le serveur (mais vu ce que tu as dit prĂ©cĂ©demment, la rĂ©ponse va ĂȘtre “à l’écoute”).
Si on résume :

  • la connexion en ssh sur le serveur fonctionne (le service est actif et tu peux te connecter depuis l’extĂ©rieur)
  • le serveur YNH communique bien avec les autres machines du mĂȘme rĂ©seau (ping voire ssh vers autre machine)
  • le fichier de conf /etc/ssh/sshd_config n’a pas Ă©tĂ© modifiĂ© (et un yunohost tools regen-conf ssh --debug voire yunohost tools regen-conf global ont Ă©tĂ© tentĂ©s)
  • la jail sshd est vide
  • mais toutes les connexions en ssh depuis ton rĂ©seau local Ă©chouent (avec un message “no route to host”) comme si ce dernier Ă©tait banni ou filtrĂ©.

Il serait peut-ĂȘtre intĂ©ressant de voir ce que renvoie, depuis une machine client, sur le rĂ©seau local, nmap -p 22,80,443 192.168.1.58

Just tried to change server ssh port to 26 and then:

$ ssh pascal@192.168.1.58 -p 26
ssh: connect to host 192.168.1.58 port 26: No route to host

I’m becoming crazy with that ;'(

Salut,
voici les résultats:

pascal@pascal-Latitude-5580:~$ nmap -p 22,80,443 192.168.1.58
Starting Nmap 7.95 ( https://nmap.org ) at 2025-05-02 15:15 CEST
Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn
Nmap done: 1 IP address (0 hosts up) scanned in 3.05 seconds
pascal@pascal-Latitude-5580:~$ nmap -Pn 22,80,443 192.168.1.58
Starting Nmap 7.95 ( https://nmap.org ) at 2025-05-02 15:15 CEST
Failed to resolve "22,80,443".
Nmap scan report for 192.168.1.58
Host is up (0.094s latency).
All 1000 scanned ports on 192.168.1.58 are in ignored states.
Not shown: 990 filtered tcp ports (no-response), 10 filtered tcp ports (host-unreach)

Nmap done: 1 IP address (1 host up) scanned in 6.59 seconds
pascal@pascal-Latitude-5580:~$

Sans le ping, la commande est: nmap -Pn -p 22,80,443 192.168.1.58
=> c’est pour voir quels ports seraient filtrĂ©s (adapte du coup le 22 en fonction du changement que tu as effectuĂ©)

Il y a de quoi