Mac(lion)でhomebrewを使ってsshでリモートサーバーをマウントする環境を整える

MacFUSEとかOSXFuseとか色々あるみたいですがhomebrew経由でインストールしたソフトだけで環境を作りたかったのでメモ。
まずsshfsを確認します。

➜  ~  brew info sshfs
sshfs 2.4.0
http://fuse.sourceforge.net/sshfs.html
Depends on: pkg-config, fuse4x, glib, automake, automake, libtool
Not installed
https://github.com/mxcl/homebrew/commits/master/Library/Formula/sshfs.rb

==> Caveats
Make sure to follow the directions given by `brew info fuse4x-kext`
before trying to use a FUSE-based filesystem.

先にfuse4xを設定しろと言われるので従います。

➜  ~  brew info fuse4x-kext
fuse4x-kext 0.9.0
http://fuse4x.org/
/usr/local/Cellar/fuse4x-kext/0.9.0 (5 files, 272K) *
https://github.com/mxcl/homebrew/commits/master/Library/Formula/fuse4x-kext.rb

==> Caveats
In order for FUSE-based filesystems to work, the fuse4x kernel extension
must be installed by the root user:

  sudo cp -rfX /usr/local/Cellar/fuse4x-kext/0.9.0/Library/Extensions/fuse4x.kext /Library/Extensions
  sudo chmod +s /Library/Extensions/fuse4x.kext/Support/load_fuse4x

If upgrading from a previous version of Fuse4x, the old kernel extension
will need to be unloaded before performing the steps listed above. First,
check that no FUSE-based filesystems are running:

  mount -t fuse4x

Unmount all FUSE filesystems and then unload the kernel extension:

  sudo kextunload -b org.fuse4x.kext.fuse4x

言われた通りに進めます。

brew install fuse4x-kext
sudo cp -rfX /usr/local/Cellar/fuse4x-kext/0.9.0/Library/Extensions/fuse4x.kext /Library/Extensions
sudo chmod +s /Library/Extensions/fuse4x.kext/Support/load_fuse4x

念のためこの段階で再起動しておきます。
最後にsshfsを入れます。

brew install sshfs

あとは普通にいけます。

mkdir mnt
sshfs username@host:path mnt

アンマウントはumount

umount mnt