Skip to content

Instantly share code, notes, and snippets.

@franz-josef-kaiser
Last active March 24, 2021 09:36
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save franz-josef-kaiser/9430475a1e9b85fcf82e474e417abaf2 to your computer and use it in GitHub Desktop.
Save franz-josef-kaiser/9430475a1e9b85fcf82e474e417abaf2 to your computer and use it in GitHub Desktop.
Example of SSHFS remote filesystem mounting. Useful in case one needs to access files created on a remote server on a regular basis
#!/usr/bin/env bash
sshfs \
user@example.com:/home/user/project /local/folder/to/project \
-o ServerAliveInterval=15 \
-o ServerAliveCountMax=20 \
-o reconnect \
-o defer_permissions \
-o negative_vncache \
-o volname=vendorname \
-o IdentitiesOnly=yes \
-o IdentityFile=/Users/username/.ssh/keyname \
-o PreferredAuthentications=publickey \
-o Ciphers=arcfour256 \
-o auto_cache \
-o cache_timeout=300 \
-o cache=yes
# Increase speed with weaker (but still good enough) encrypted Ciphers:
# aes128-ctr, aes192-ctr, aes256-ctr
# The fastest being arcfour256 followed by chacha20-poly1305@openssh.com which both are incredibly secure
# @link https://wiki.mozilla.org/Security/Guidelines/OpenSSH#Configuration
# Performance Benchmarks
# @link http://wiki.csnu.org/index.php/SSH_ciphers_speed_comparison
# @link https://blog.famzah.net/2010/06/11/openssh-ciphers-performance-benchmark/
# Large files should be compressed:
# -o Compression=yes \
# -o CompressionLevel=9 \ # Range: 1-9
# cache_timeout and ServerAliveInterval are set in seconds
# For the cache timeout you might want to set the time, the remote server needs
# to update its files, plus 1/6 to make sure you only get fresh files.
# @TODO Make sure this file is called when the server starts or reboots
# As an alternative, you can use CurlFtpFS, props @screamingdev Mike Pretzlaw
# @link http://curlftpfs.sourceforge.net/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment