Ubuntu : sudo apt-get install sshfs 安装即可
sshfs [email protected]:/opt /mnt 即可挂载192.168.5.121 上的opt目录, 具体使用方法查看 sshfs -h
Centos fuse-sshfs rpm包下载地址:wget http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/fuse-sshfs-2.2-1.el6.rf.x86_64.rpm
挂载方法同上
写的话使用fusermount 命令
fusermount -u /mnt
也可以使用umount 命令卸载 umount /mnt
附件fuse-sshfs 安装包
错误处理:
rpm -vih fuse-sshfs-2.2-1.el6.rf.x86_64.rpm
warning: fuse-sshfs-2.2-1.el6.rf.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 6b8d79e6: NOKEY
error: Failed dependencies:
libfuse.so.2()(64bit) is needed by fuse-sshfs-2.2-1.el6.rf.x86_64
libfuse.so.2(FUSE_2.2)(64bit) is needed by fuse-sshfs-2.2-1.el6.rf.x86_64
libfuse.so.2(FUSE_2.5)(64bit) is needed by fuse-sshfs-2.2-1.el6.rf.x86_64
libfuse.so.2(FUSE_2.6)(64bit) is needed by fuse-sshfs-2.2-1.el6.rf.x86_64
libfuse.so.2(FUSE_2.7)(64bit) is needed by fuse-sshfs-2.2-1.el6.rf.x86_64
yum install fuse-devel fuse-libs fuse
(编译安装的话可能会有个错误,
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking whether gcc and cc understand -c and -o together... yes
checking for library containing dlsym... -ldl
checking OpenSSH version... 5.3 >= 4.4, disabling NODELAY workaround
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for SSHFS... no
configure: error: Package requirements (fuse >= 2.3 glib-2.0 gthread-2.0) were not met:
No package 'fuse' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables SSHFS_CFLAGS
and SSHFS_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
) 在 yum install glib-devel