I have SSHFS on my server and would like to have it automatically mounted and store all of the documents, desktop, downloads, etc. on a couple computers. I am able to get it to all work except for mounting on startup. The server is Debian 12 and both clients are Tumbleweed. Nothing in fstab seems to work. When I add x-systemd.automount, well, at best programs that try to use it crash and at worst I have to go through recovery mode to get the system to boot properly. I am using ed25519 keys with no passwords for authentication. Does anyone know how I could get this to work?

  • ichbinjasokreativ@lemmy.world
    link
    fedilink
    English
    arrow-up
    5
    ·
    10 months ago

    Write a systemd service, that’s how my computers mount my nas. you just need to have it run under your user instead of root or point it towards the right keys manually.

    • qaz@lemmy.world
      link
      fedilink
      English
      arrow-up
      4
      ·
      9 months ago

      And consider adding a timeout, or else all your devices will take and additional 2 minutes to boot if the server is offline and the mount fails.

      • ichbinjasokreativ@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        9 months ago

        I just have them check for my wifi. If that’s what they’re connected to, then the nas is available. If not, then there’s no point trying to mount it. However, one day every month my nas pulls updates and shuts down afterwards, so that I need to boot it again when I get home from work. But my laptop boots just as fast as it normally does, even though it fails to connect to the nas.