为什么我不能设置SSHFS共享? “OSXFUSE文件系统不可用”错误

我想从我的本地机器设置一个SSHFS共享到远程机器,但它不工作。 我收到错误OSXFUSE文件系统不可用(见下文)。 如何解决这个问题?

仅供参考,我的本地机器是运行OSX 10.9.3的MacBook Pro笔记本电脑。 远程机器实际上是运行CentOS的相同硬件上的一个VirtualBox。

% brew install sshfs # <---- SSHFS is installed Warning: sshfs-2.5.0 already installed % brew install osxfuse # <---- OSX Fuse is installed Warning: osxfuse-2.6.4 already installed % ssh [email protected] # <---- See, SSH works!! Last login: Wed Jun 18 18:36:11 2014 from XXX.XXX.XXX.XXX [[email protected] ~]% exit % sudo mkdir /mnt % sudo mkdir /mnt/Share % sudo sshfs -o IdentityFile=~/.ssh/id_rsa.pub [email protected]:/ /mnt/Share the OSXFUSE file system is not available (-1) the OSXFUSE file system is not available (1) 

我试过这里描述的解决scheme 但这对我并不起作用:

 % sudo kextunload -b com.github.osxfuse.filesystems.osxfusefs (kernel) Kext com.github.osxfuse.filesystems.osxfusefs not found for unload request. Failed to unload com.github.osxfuse.filesystems.osxfusefs - (libkern/kext) not found. 

你可以用Homebrew Cask安装:

brew install Caskroom/cask/osxfuse

因为:

 osxfuse: A full installation of Xcode.app is required to compile this software. Installing just the Command Line Tools is not sufficient. Xcode can be installed from the App Store. osxfuse: Building this formula from source isn't possible due to OS X Yosemite and above's strict unsigned kext ban. 

我不是这方面的专家,但这种configuration为我工作。

安装OSXFUSE

 Download OSXFUSE 2.6.0 @ http://osxfuse.github.io/2013/06/17/OSXFUSE-2.6.0.html With the file downloaded, right click on the .dmg file, open and install it. 

安装SSHFS

如果您还没有安装Brew,请转至http://brew.sh/并安装它&#x3002;

安装Brew后,在Terminal中运行:

 brew install sshfs 

如果遇到“同意Xcode / iOS许可证需要pipe理员权限,请通过sudo以root用户身份重新运行”的错误,您只需打开Xcode并接受协议,然后等待安装最后一个补丁程序即可。

下一个必须解决的错误是XCode仍然使用10.8而不是10.8的SDK。 如果你得到一个错误:“xcodebuild:error:SDK”macosx10.9“找不到”,你需要编辑位于/usr/local/Library/Formula/fuse4x-kext.rb的fuse4x-kext.rb :

 Replace on line 21: “macosx#{MacOS.version}” with “macosx10.8“, while keeping line 24 (MACOSX_DEPLOYMENT_TARGET) the same. 

安装完成后,Brew会显示一条消息:“为了使基于FUSE的文件系统正常工作,fuse4x内核扩展必须由root用户安装:”,因此只需执行以下两行:

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

完成这一切后,您应该可以通过SSH安装任何远程文件系统。

要创build您要安装文件系统的path,请执行以下操作:

 mkdir -pv ~/path/to/mount 

最后安装系统:

 sshfs -C -p PORT user@server:/ ~/path/to/mount 

希望这可能也适合你。