Last active
April 26, 2018 01:32
-
-
Save junjuew/21a05adfbb92336c12fffb17f41f59a6 to your computer and use it in GitHub Desktop.
sshfs command to automatically reconnect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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