Skip to content

Instantly share code, notes, and snippets.

@bmsimons
Last active January 19, 2026 22:13
Show Gist options
  • Select an option

  • Save bmsimons/6a21ca5bf7ed3bbb9e55853b58dc0593 to your computer and use it in GitHub Desktop.

Select an option

Save bmsimons/6a21ca5bf7ed3bbb9e55853b58dc0593 to your computer and use it in GitHub Desktop.
Mount sshfs as a systemd service for a host with password authentication

Do not forget to:

  • chmod 700 the mountshare.sh script.
  • run systemctl daemon-reload before you systemctl enable mountshare.service.
[Unit]
Description=Service for mounting the Hetzner share
After=network.target
[Service]
Type=simple
User=root
ExecStart=/usr/local/sbin/mountshare.sh
[Install]
WantedBy=multi-user.target
#!/bin/bash
sshfs -f -o allow_other,default_permissions,reconnect,password_stdin username@username.your-storagebox.de:/backup /mnt/backup <<< 'passwordgoeshere'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment