Skip to content

Instantly share code, notes, and snippets.

@gwpl
Last active May 7, 2016 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gwpl/a230b76ff2fa82e1382b9ec7be120263 to your computer and use it in GitHub Desktop.
Save gwpl/a230b76ff2fa82e1382b9ec7be120263 to your computer and use it in GitHub Desktop.
sshfs mount config snippets
#/etc/fstab
# remote on remoteY ( remoteY has to be defined in /root/.ssh/config,/home/userX/.ssh/config )
userX@remoteY:/mnt/remoteY/ext4/userX/mount /mnt/remoteY_mount fuse.sshfs noauto,x-systemd.automount,x-systemd.device-timeout=10,_netdev,user,idmap=user,transform_symlinks,identityfile=/home/gwpl/.ssh/id_ecdsa521_sftplenovox230,allow_other,default_permissions,uid=123456789,gid=100,reconnect 0 0
# assuming 123456789 is UID and 100 GID desired of mount
# /etc/systemd/system/killsshfs_on_shutdown.service
# remember to systemctl enable killsshfs_on_shutdown.service
[Unit]
After=network.target
[Service]
RemainAfterExit=yes
ExecStart=-/bin/true
ExecStop=-/usr/bin/pkill sshfs
[Install]
WantedBy=multi-user.target
# from: https://wiki.archlinux.org/index.php/SSHFS#Troubleshooting
# .ssh/config
Host remoteY
TCPKeepAlive yes
ServerAliveCountMax 1
ServerAliveInterval 5
# from : Prevent Hanging sshfs Connections https://www.johnhawthorn.com/2011/04/prevent-hanging-sshfs-connections/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment