shfsでsshを使ってサーバのディスクをマウントする

「shfs」ってのがあるんですね。 sshが使える環境であれば、サーバのディスクをマウント出来るみたいです。

smbとかなくても、sshのみでサーバのディスクが使えるのは嬉しい!!

環境

  • macOS 10.13.4
  • Homebrew 1.6.7

手順

まずは homebrewにてshfsをインストールします。

$ brew install sshfs
 ・
 ・
 ・
shfs: OsxfuseRequirement unsatisfied!
You can install with Homebrew-Cask:
 brew cask install osxfuse
You can download from:
 https://osxfuse.github.io/
Error: An unsatisfied requirement failed this build.

おっと、osxfuseってのが必要なようですね。 では、指示に従ってインストール。

$ brew cask install osxfuse
 ・
 ・
 ・
🍺  osxfuse was successfully installed!

$ brew install sshfs
 ・
 ・
 ・
🍺  /usr/local/Cellar/sshfs/2.10: 6 files, 94.4KB

無事インストール完了。

使い方

こんな感じで使えます。詳細はman sshfsで。

sshfs [user@]host:[dir] mountpoint [options]

これから学ぶmacOSターミナル

新品価格
¥2,808から
(2018/6/9 15:52時点)