ssh connection refused

  • I use Libreelec on a Raspberry since a lot of time,

    and I never had problems connecting to it (from a Mac or from a Linux machine), usually to copy files or general maintenance.

    Today, without changing anything, I see that I cannot connect to it anymore, getting a ssh: connect to host kodi port 22: Connection refused error.

    kodi is the machine name,and is perfectly visible:


    # ping kodi

    PING kodi (192.168.1.136) 56(84) bytes of data.

    ...

    using Libreelec with the remote, I can see it perfectly running, with its 192.168.1.136 address correctly set, and the ssh enabled as usual.

    Please, what do you suggest I do to debug this?

    thank you!

    Alessandro

  • The most common cause of "SSH refusal" is old versions of PuTTY on Windows (ciphers changed, no longer compatible) but that's rarely the issue with macOS/Linux clients. Did you enable "disable password auth" in LE settings?

  • The most common cause of "SSH refusal" is old versions of PuTTY on Windows (ciphers changed, no longer compatible) but that's rarely the issue with macOS/Linux clients. Did you enable "disable password auth" in LE settings?

    No, I didnt - I always autenticate by password.

    BTW, I have other two (older) raspberry at home on the local network, and I can connect to them just fine by ssh...

  • On the client side ssh -vvv ... will show what is going on.

    On the RPI create a log via LE Settings Addon or Samba share and check for errors.

  • Well this was happening to me consistently and this is how I fixed it. I mounted the SAMBA logfiles share and found this gem:

    Quote

    @@@@@@@@@@@@@@@@@@@@@@@@@@
    @ WARNING: UNPROTECTED PRIVATE KEY FILE! @

    @@@@@@@@@@@@@@@@@@@@@@@@@@

    Permissions 0620 for '/storage/.cache/ssh/ssh_host_rsa_key' are too open.

    It is required that your private key files are NOT accessible by others.

    This private key will be ignored.

    1. I shut down the rpi400 and yanked the sd card

    2. I inserted the SD Card into my iMac running fedora

    3. nothing happened

    4. commence searching!

    5. running `lspci` I discovered with some chagrin that I owned a Broadcom BCM57765/57785 SDXC/MMC Card Reader

    6. I ran these commands to mount my wicked high speed sd card as just-sort-highish speed

    Code
    sudo rmmod sdhci_pci sdhci
    sudo modprobe sdhci debug_quirks2=4
    sudo modprobe sdhci_pci

    A quick reinsertion of the card sufficed. With the SD card mounted I `cd`'d to libreelec's /storage/.cache/ssh and did a

    Code
    sudo chmod 600 ./*

    That having been accomplished, I reinserted the card and rebooted, and hey presto, ssh works again, I no longer need to mount the farkakte smb shares.