Skip to content

Instantly share code, notes, and snippets.

@junjuew
Last active April 26, 2018 01:32
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 junjuew/21a05adfbb92336c12fffb17f41f59a6 to your computer and use it in GitHub Desktop.
Save junjuew/21a05adfbb92336c12fffb17f41f59a6 to your computer and use it in GitHub Desktop.
sshfs command to automatically reconnect
# Mount a path from a server to local machine
# Command to use on local machine
sshfs -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3 username@host:/host/path /mnt/path
# enter ssh password in stdin
sshfs -o password_stdin,reconnect,ServerAliveInterval=15,ServerAliveCountMax=3,StrictHostKeyChecking=no username@host:/host/path /mnt/path
# Reverse mount
# issue from the sshfs SERVER to let a CLIENT mount a SERVER directory
dpipe /usr/lib/openssh/sftp-server = ssh CLIENT sshfs :/mnt/host/path /mnt/client/path -o slave,reconnect,ServerAliveInterval=15,ServerAliveCountMax=3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment