kuroの覚え書き

96の個人的覚え書き

[Mac] sshfs

linuxディレクトリをssh経由でmacにマウントするsshfs

$ brew install sshfs
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core, homebrew/science).
==> New Formulae
chronograf
==> Updated Formulae
aalib                                    homebrew/science/octave
ammonite-repl                            homebrew/science/openimageio
antigen                                  homebrew/science/pcl
artifactory                              homebrew/science/qrupdate
aws-sdk-cpp                              homebrew/science/scram
awscli                                   homebrew/science/slepc
bandcamp-dl                              homebrew/science/swrcfit
bluepill                                 homebrew/science/topcat
buildifier                               homebrew/science/vtk
clutter                                  homebrew/science/xmi-msim
consul                                   ibex
cppcheck                                 imagemagick
davix                                    imagemagick@6
dbt                                      jenkins
elixir                                   juise
fades                                    kafkacat
flatcc                                   libfabric
folly                                    libmemcached
freeimage                                libslax
freetype                                 lumo
gauge                                    luvit
gexiv2                                   nnn
glib                                     openvpn
glog                                     planck
gnome-recipes                            plantuml
gnu-typist                               pwntools
gnupg                                    ripgrep
gobject-introspection                    s3fs
grpc                                     scw
gspell                                   snapraid
gucharmap                                sonar-scanner
halibut                                  source-to-image
heroku                                   sourcekitten
homebrew/science/anvio                   streamlink
homebrew/science/cdo                     swiftformat
homebrew/science/cmor                    sysbench
homebrew/science/dealii                  sysdig
homebrew/science/etsf_io                 tbb ✔
homebrew/science/fgsl                    telegraf
homebrew/science/gmt                     terminal-notifier
homebrew/science/gmt4                    tippecanoe
homebrew/science/gnudatalanguage         upx
homebrew/science/igv                     urh
homebrew/science/igvtools                vagrant-completion
homebrew/science/insighttoolkit          vamp-plugin-sdk
homebrew/science/kat                     weechat
homebrew/science/libbi                   yarn
homebrew/science/med-file                youtube-dl
homebrew/science/nco                     zsh-completions
homebrew/science/ncview
==> Deleted Formulae
dvtm

sshfs: 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
==> Caveats
You must reboot for the installation of osxfuse to take effect.

==> Downloading https://github.com/osxfuse/osxfuse/releases/download/osxfuse-3.5
######################################################################## 100.0%
==> Verifying checksum for Cask osxfuse
==> Installing Cask osxfuse
==> Running installer for osxfuse; your password may be necessary.
==> Package installers may write to any location; options such as --appdir are i
==> installer: Package name is FUSE for macOS
==> installer: choices changes file '/var/folders/sf/3lk5x37135586w0jgqyjq_yc000
==> installer: Installing at base path /
==> installer: The install was successful.
🍺  osxfuse was successfully installed!

FUSE for OSXってMacNTFSをマウントして読み書きできるようにするMacFUSEの後継ユーティリティなんだな。
環境設定パネルにもなんか増えてる。
んで

$ brew install sshfs
==> Installing dependencies for sshfs: gettext, libffi, pcre, glib
==> Installing sshfs dependency: gettext
==> Downloading https://homebrew.bintray.com/bottles/gettext-0.19.8.1.el_capitan
######################################################################## 100.0%
==> Pouring gettext-0.19.8.1.el_capitan.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.

macOS provides the BSD gettext library & some software gets confused if both are in the library path

If you need to have this software first in your PATH run:
  echo 'export PATH="/usr/local/opt/gettext/bin:$PATH"' >> ~/.bash_profile

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/gettext/lib
    CPPFLAGS: -I/usr/local/opt/gettext/include

==> Summary
🍺  /usr/local/Cellar/gettext/0.19.8.1: 1,934 files, 16.9MB
==> Installing sshfs dependency: libffi
==> Downloading https://homebrew.bintray.com/bottles/libffi-3.2.1.el_capitan.bot
######################################################################## 100.0%
==> Pouring libffi-3.2.1.el_capitan.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.

some formulae require a newer version of libffi

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/libffi/lib

==> Summary
🍺  /usr/local/Cellar/libffi/3.2.1: 16 files, 296.9KB
==> Installing sshfs dependency: pcre
==> Downloading https://homebrew.bintray.com/bottles/pcre-8.40.el_capitan.bottle
######################################################################## 100.0%
==> Pouring pcre-8.40.el_capitan.bottle.tar.gz
🍺  /usr/local/Cellar/pcre/8.40: 204 files, 5.4MB
==> Installing sshfs dependency: glib
==> Downloading https://homebrew.bintray.com/bottles/glib-2.52.2.el_capitan.bott
######################################################################## 100.0%
==> Pouring glib-2.52.2.el_capitan.bottle.tar.gz
==> Using the sandbox
🍺  /usr/local/Cellar/glib/2.52.2: 430 files, 22.6MB
==> Installing sshfs 
==> Downloading https://homebrew.bintray.com/bottles/sshfs-2.9.el_capitan.bottle
######################################################################## 100.0%
==> Pouring sshfs-2.9.el_capitan.bottle.tar.gz
🍺  /usr/local/Cellar/sshfs/2.9: 7 files, 98.0KB

入った。

$ mkdir mnt
とマウントポイントを適当に作って
$ sshfs [linux_user_name]@[linux_IP_address]:[マウントしたいdir] mnt
これでOK