Skip to content

Instantly share code, notes, and snippets.

@cyqsimon
Created December 16, 2025 08:18
Show Gist options
  • Select an option

  • Save cyqsimon/0ab3f107f022267cb7e5244b233ae713 to your computer and use it in GitHub Desktop.

Select an option

Save cyqsimon/0ab3f107f022267cb7e5244b233ae713 to your computer and use it in GitHub Desktop.
systemd mount unit using sshfs and password authentication
[Unit]
Description=SSHFS mount on /mnt/my-data
After=network-online.target
Wants=network-online.target
Before=remote-fs.target
[Mount]
What=user@remote.exmaple.com:/path/to/source
Where=/path/to/dest
Type=fuse.sshfs
Options=allow_other,compression=yes,auto_cache,reconnect,ssh_command=sshpass\040-e\040ssh,port=22
Environment="SSHPASS=my-password"
[Install]
WantedBy=multi-user.target
@cyqsimon
Copy link
Author

Required packages (EL9): sshpass and fuse-sshfs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment