PXE Boot but no SSH after install

  • I successfully have an RPi3 booting LibreELEC 9.2 over PXE. Everything in that respect works. It’s really just for proof of concept to test everything out.


    The issue I am having is SSH no longer works. My commandline.txt file has quiet ssh ip=dhcp at the end of it. In Kodi under the LibreELEC settings Add-On at first the option to enable SSH was not there under the Services tab, so I removed ssh from my commandline.txt and rebooted and now it shows up and shows as on, regardless if I keep it removed or put it back in commandline.txt

    However, when I open a terminal from another computer on the same network and type ssh [email protected] (that’s the correct IP) I get ssh: connect to host 192.168.1.30 port 22: Connection refused. I tried a fresh install again and dropped a blank file titled “ssh” in the boot folder but that didn’t change anything.


    What am I doing wrong or what do I need to do to get SSH working? Is it something to do with booting over PXE and technically no local install, rather I’m theoretically trying to ssh into the server over NFS instead?

  • ok I added textmode to the command line file and got a shell on boot. Of course when I did this I failed to realize I needed a keyboard plugged into the pi... This is where my knowledge of Linux/LibreELEC and the underlying system starts to dwindle. What logs would I be looking for? I'm assuming I need to begin with making sure the SSH service is started first.

    On a side note, I just updated to LE 9.2 and am successfully booting over pxe, however I'm back to square one with the connection refused when trying to SSH from another machine and the enable SSH option is missing from the LE add-on.

    Edited once, last by squirtbrnr (October 31, 2022 at 12:50 PM).

  • Status of sshd service:

    Code
    systemctl status sshd

    Complete sshd log:

    Code
    journalctl -u sshd

    Create log summary on pastebin site and print URL:

    Code
    pastekodi
  • systemctl status ssh

    reports: Unit ssh.service could not be found.

    journalctl -u sshd

    reports the sshd.service exited with code "FAILURE" and appears the reason is it could not save the public keys and therefore could not find any public keys to start with. The specific error can be found in the log posted below.

    http://ix.io/23ao

    Looks like maybe I have some permissions issues on the TFTP server for PXE booting... which is odd because I can access, save, and modify files from another machine.

  • Deleted the files in the storage folder for the RPi on the TFTP server and set all folders to have the appropriate owner. Restarted the RPi and everything booted up as expected and this time it actually ran me through the setup wizard. I changed my settings accordingly and attempted to SSH in however it's not accepting the default SSH password. I changed the password using the LibreELEC settings add-on, restarted the SSH service and restarted the RPi but it still won't let me SSH. I can get it to prompt me for a password, but it fails saying incorrect password.

  • Apologies for the delay in response. Thank you mglae for working through this with me.

    systemctl status sshd returns:

    I'm assuming you meant add textmode and not "fextmode". I have added it again. Still looks like I have a permissions issue in my initial setup of the pxeboot because if I try to ssh out of the PXE client even to localhost, it gives me an error:

    EDIT: I deleted all of the files in the pxeboot storage location and started from scratch. SSH starts, and I am in textmode but when I try to ssh to localhost it asks for the password (default at this time), I type it in and it just says Permission denied, please try again. So my permission issues have been resolved, but now I'm back to the default password not working.

    systemctl status ssh afterwards reports 3 failed password attempts for root and a connection closed.

    Edited once, last by squirtbrnr (January 5, 2020 at 4:54 PM).

  • Even on a fresh install the files/folders get owned by "admin". This most likely has to do with the pxeboot setup, but I'm not sure. That's the user "1024" in place of the root user on the ls -al command. If I try to chown -R root /storage I've experienced both the inability to boot and an error in the command line effectively saying it wouldn't let me.

  • Unfortunately I don't use Ubuntu. My setup is a Synology NAS hosting the NFS share, Unifi using DHCP Network Boot options to point clients to the NAS TFTP/PXE server hosting bootcode.bin. This is the guide I followed for the NFS share: Network Booting LibreElec to Raspberry Pi's from a Synology NAS - Upods.netUpods.net and this link for the TFTP/PXE server: DiskStation Manager - Knowledge Base | Synology Inc. and I think I found a few pointers for the Unifi configuration on their forums but don't remember exactly where I found them.

    From the first guide, the squash settings are set to map all users to admin. I followed all other settings in that guide. I might have changed 1 or two things like the exact folder path, but none of the other settings changed that I remember. Here's a screenshot of my Synology NFS share permissions:

    The options in the squash settings dropdown are:

    - No Mapping

    - Map root to admin

    - Map root to guest

    - Map all users to admin

    - Map all users to guest

    my /etc/exports file does not look like what is in that wiki guide:

    Code
    /volume1/Saturn *(rw,async,no_wdelay,crossmnt,insecure,all_squash,insecure_locks,sec=sys,anonuid=1024,anongid=100)

    And with this being on a Synology, I'm not quite sure what would happen manually editing that file. It may get overwritten, or not survive reboots, etc.

  • Terribly sorry for the long delay. I've recently moved and just got everything set back up.

    I changed the squash settings to "No Mapping" and it looks like I can SSH in and it accepts the password and appears to be working. Kudos to mglae for helping me out. looks like the squash settings was the last piece to making this work. Now if I can just get the booting to be a little more reliable (about 1 in 4 boots fails at a black screen and no activity light)... but that's for another thread and may not be LibreELEC related.

  • Hi squirtbrnr ,

    I updated the upods.net guide that I wrote to select "No Mapping" on the Synology. After changing that setting on my Synology, I noticed that I was still getting a "connection refused" error. After checking the log, I saw that I just needed to create a folder at /storage/.cache/ssh on the TFTP server and then I was able to establish an SSH connection. I am also using a Raspberry Pi 3 and have the same issue with booting. I found that by copying a newer version of bootcode.bin to a blank micro SD card fixes the problem, but then an SD card is still having to be used which kinda defeats the purpose of network booting.