使用sshfs挂载远程主机文件到linux
2016-08-04 17:42
731 查看
场景:
将远程Windows系统主机上的文件夹挂载到本地linux主机指定目录下。
Windows系统主机上的文件夹:d:\Work\workspace
Windows系统主机用户:host_name
Windows系统主机IP:host_ip
linux主机指定目录:/mnt/win_workspace/
1、创建挂载点,修改权限
2、使用sshfs挂载
3、然而報错
看到很多????
4、解决方法[1]
可以看到,之前出现的很多???消失了。
5、修改文件/etc/fuse.conf
为了使用user_allow_other,需要将文件的最后一行user_allow_other前面的注释符号#去掉,修改成如下。
6、使用sshfs的额外配置项连接
接下来正常的话,需要输入密码,然后OK了。
默认windows的22号端口是关闭的,我是安装了Bitvise SSH Server.
参考文献:
[1] http://slopjong.de/2013/04/26/sshfs-transport-endpoint-is-not-connected/comment-page-1/#comment-219607
将远程Windows系统主机上的文件夹挂载到本地linux主机指定目录下。
Windows系统主机上的文件夹:d:\Work\workspace
Windows系统主机用户:host_name
Windows系统主机IP:host_ip
linux主机指定目录:/mnt/win_workspace/
1、创建挂载点,修改权限
yang@master$ sudo mkdir win_workspace yang@master:$ sudo chgrp -R yang win_workspace/ yang@master:$ sudo chown -R yang win_workspace/
2、使用sshfs挂载
yang@master:~$ sshfs host_name@host_ip:/d:\Work\workspace /mnt/win_workspace/
3、然而報错
fuse: bad mount point `/mnt/win_workspace/': Transport endpoint is not connected
yang@master:~$ ll /mnt/ ls: cannot access '/mnt/win_workspace': Transport endpoint is not connected total 8 drwxr-xr-x 3 root root 4096 Aug 4 16:59 ./ drwxr-xr-x 24 root root 4096 Jul 29 09:39 ../ d????????? ? ? ? ? ? win_workspace/
看到很多????
4、解决方法[1]
yang@master:~$ sudo umount -l /mnt/win_workspace yang@master:~$ ll /mnt/ total 12 drwxr-xr-x 3 root root 4096 Aug 4 16:59 ./ drwxr-xr-x 24 root root 4096 Jul 29 09:39 ../ drwxr-xr-x 2 yang yang 4096 Aug 4 16:59 win_workspace/
可以看到,之前出现的很多???消失了。
5、修改文件/etc/fuse.conf
yang@master:~$ vi /etc/fuse.conf
为了使用user_allow_other,需要将文件的最后一行user_allow_other前面的注释符号#去掉,修改成如下。
# /etc/fuse.conf - Configuration file for Filesystem in Userspace (FUSE) # Set the maximum number of FUSE mounts allowed to non-root users. # The default is 1000. #mount_max = 1000 # Allow non-root users to specify the allow_other or allow_root mount options. user_allow_other
6、使用sshfs的额外配置项连接
yang@master:~$ sudo sshfs -d -o allow_other -o reconnect -o ServerAliveInterval=15 host_name@host_ip:/d:/Work/workspace/ /mnt/win_workspace/ -p 22 -C FUSE library version: 2.9.4 nullpath_ok: 0 nopath: 0 utime_omit_ok: 0
接下来正常的话,需要输入密码,然后OK了。
默认windows的22号端口是关闭的,我是安装了Bitvise SSH Server.
参考文献:
[1] http://slopjong.de/2013/04/26/sshfs-transport-endpoint-is-not-connected/comment-page-1/#comment-219607
相关文章推荐
- 使用 SSHFS 挂载远程的 Linux 文件系统及目录
- 使用 SSHFS 挂载远程的 Linux 文件系统及目录
- 使用 SSHFS 挂载远程的 Linux 文件系统及目录
- 使用 SSHFS 挂载远程的 Linux 文件系统及目录
- 使用 SSHFS 挂载远程的 Linux 文件系统及目录
- 如何使用_SSHFS_通过_SSH_挂载远程的_Linux_文件系统或者目录
- 如何在 Linux 上使用 SSHfs 挂载一个远程文件系统
- 如何使用 SSHFS 通过 SSH 挂载远程的 Linux 文件系统或者目录
- 如何在 Linux 上使用 SSHfs 挂载一个远程文件系统
- 使用 SSHFS 挂载远程的 Linux 文件系统及目录
- linux 将更新的文件copy到sshfs挂载主机,监测sshfs,不存在则启动
- 通过sshfs挂载远程主机文件系统
- 通过SSHFS在RHEL中安全的挂载远程Linux/UNIX目录或文件系统--转载
- Mac OS X 使用sshfs挂载Linux远程服务器磁盘
- Mac OS X 使用sshfs挂载Linux远程服务器磁盘
- Linux使用sshfs挂载远程目录到本地
- LINUX 下面不同主机远程拷贝文件 scp 命令的使用
- linux下使用sshfs挂载远程linux文件系统或目录
- 通过SSHFS在RHEL中安全的挂载远程Linux/UNIX目录或文件系统
- Mac OS X使用sshfs挂载Linux远程分区