Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save a-maumau/cfe42b2413d486e04c293fab611f6e3e to your computer and use it in GitHub Desktop.
Save a-maumau/cfe42b2413d486e04c293fab611f6e3e to your computer and use it in GitHub Desktop.
mount remote server files with sshfs for Mac

as a premise, you can access to the remote server by ssh

Installation

You need homebrew for mac

brew install macfuse
brew install gromgit/fuse/sshfs-mac

After you install the macfuse and sshfs-mac, you may be asked to enable some kernel security stuff (for apple silicon).
You need to change the security policy.

(sorry I could not found some English page, it may transfer to your language)
https://support.apple.com/ja-jp/guide/mac-help/mchl768f7291/mac

(you can skip this part if you don't need to change the kernel security)

  1. reboot you system
  2. press command + R and get in to the boot option (for Apple silicon, press power button instead)
  3. go to "option", and login with your admin account
  4. select the utility > startup security utility in the top left menu
  5. allow the kernel extension to the identified developers
  6. reboot
  7. allow the extension in the System Settings (System Preferences), then reboot if it requires

Mount / Unmount

You can use the .ssh/config to specify a host. this means you can pass the jump server.
In my environment, I could not use ~ for a path of remote server. So you may should use /home/....

# mount
sshfs your_remote_server:/dir/which/you/want /where/you/want/to/mount

# unmount
umount -f /where/you/want/to/mount

Ref

https://zenn.dev/as_pml/articles/324fc50eab73fd

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