SBC is refusing SSH connection



  • Hey,

    so I had to reflash the DuetPi image to my Raspberry Pi SD-Card a couple of times because I am unsuccessfully trying to get a PI webcam stream running.

    Usually I could follow the steps from the getting started guide...flash the image with etcher, configure Wi-Fi in the wpa_supplicant.conf file, boot on the pi and configure the rest via SSH using putty.

    But after a few back and forth the PI is refusing the SSH Connection

    error.PNG

    The SBC has an internet connection, I have checked it on the attached touchscreen.
    I am absolutely clueless

    -Max



  • Or add a blank file called "SSH" in the boot partition before first boot.



  • @MaxGyver said in SBC is refusing SSH connection:

    But after a few back and forth the PI is refusing the SSH Connection

    given thats not the dafault behaviour; are you sure you have the correct ip?


  • Moderator

    You're the second person to mention SSH not working out of the box on the duet pi image. I wonder if something changed in the recent build? @chrishamm



  • (I tried the 2020-08-22-DuetPi-lite.img yesterday, SSH enabled and running, no iptables rules. Is there a updated image i didn't see?)



  • @bearer I am experiencing this issue only with the normal DuetPi version. As far as I remember the Duet Pi-lite version is working as intended. But since I am using the 7" Raspberry Pi Touch Display I need the GUI. On booting, this Wi-Fi setup wizard appears. Although I have configured the Wi-Fi in the wpa_supplicant.conf file beforehand. I do not remember seeing this during previous installations.

    IMG_20201120_222453.jpg

    -Max



  • This post is deleted!


  • @MaxGyver said in SBC is refusing SSH connection:

    previous installations. I do not remember seeing this during

    oddly enough none lite image doens't contain the /boot/wpa_supplicant.conf template but doesn't matter if you roll your own. although if it ends up as /boot/wpa_supplicant.conf.txt it won't work

    however none lite image says:

    Raspbian GNU/Linux 10 duet3 ttyAMA0
    
    duet3 login: pi
    Password:
    Last login: Sat Nov 21 14:12:11 GMT 2020 on tty1
    Linux duet3 4.19.50+ #1 Tue Nov 26 01:49:16 CET 2019 armv6l
    
    The programs included with the Debian GNU/Linux system are free software;
    the exact distribution terms for each program are described in the
    individual files in /usr/share/doc/*/copyright.
    
    Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
    permitted by applicable law.
    pi@duet3:~$ sudo service ssh status
    ΓùÅ ssh.service - OpenBSD Secure Shell server
       Loaded: loaded (/lib/systemd/system/ssh.service; disabled; vendor preset: ena
       Active: inactive (dead)
         Docs: man:sshd(8)
               man:sshd_config(5)
    pi@duet3:~$
    
    pi@duet3:~$ sudo /usr/sbin/sshd
    Missing privilege separation directory: /run/sshd
    pi@duet3:~$ sudo mkdir /run/sshd
    pi@duet3:~$ sudo /usr/sbin/sshd
    pi@duet3:~$
    

    ssh works, you can sort it out using a serial connection to the pi or qemu as a bandaid pending surgery



  • after having this grinding in the back of my mind during a fireworks display (wee!) I think this is the proper solution until a new image is built

    echo d /run/sshd 0755 root root | sudo tee /usr/lib/tmpfiles.d/sshd.conf

    (at least) four ways to apply this fix on the pi/image

    • screen and keyboard
    • serial console on the pi
    • boot the image in qemu emulator *
    • mount the image**

    *) see bottom of this post https://forum.duet3d.com/post/193770

    **) mounting the image changes the relative path, i use this script on linux to mount two parts of the image. and the command would be echo d /run/sshd 0755 root root | sudo tee ~/img/root/usr/lib/tmpfiles.d/sshd.conf

    (edit: oh, and sudo service ssh restart or sudo reboot after)



  • d'oh - never assume the simple method has been tried:

    section 3: https://www.raspberrypi.org/documentation/remote-access/ssh/



  • Or add a blank file called "SSH" in the boot partition before first boot.



  • @jay_s_uk Yep, that did the trick! Thank you!
    @bearer Your proposal worked as well, it just did not occur to me to use the attached display for enabling SSH via the GUI

    Cheers
    Max


  • administrators

    DuetPi lite has SSH enabled by default and wpa_supplicant.conf is present on the boot partition, because usually you don't have a display attached to those setups.

    DuetPi (with GUI) does not have SSH enabled by default, but you can enable it by putting an empty "ssh" file on the boot partition (like @jay_s_uk said). wpa_supplicant.conf is no longer present in this image variant because the preferred configuration method is the official setup wizard. If SSH was still enabled in the full image, you'd see a warning message about the standard password after every boot.



  • @chrishamm said in SBC is refusing SSH connection:

    If SSH was still enabled in the full image, you'd see a warning message about the standard password after every boot.

    for all intents and purposes you get the same warning on the lite image, on every login not just every boot.

    due to the odd mechanism of having it fail to start rather than being disabled it could have been an idea to document the change from the 2020-05-19 image though.


Log in to reply