samba太慢?和梦翔儿一起用ssh来共享目录吧,下面把远程150机器上的home目录,挂载到本地:
安装
sudo apt-get install sshfs
建挂载点
sudo mkdir /mnt/hadoop150
读写权限
sudo chmod 777 /mnt/hadoop150
远程挂载
sshfs cloud@192.168.88.150:/home /mnt/hadoop150
测试
cd /mnt/hadoop150/
ls
卸载
sudo umount /mnt/hadoop150
windows下能挂载吗?没问题,看这里:
http://www.dreamflier.net/blog/user1/3/2403.html
开机自动挂载?没问题,方法如下:
也可以自动挂载,主要分两步
1、设置对远程服务器的无密码登录
如图所示,无密码ssh登录的基本原理是,在本地的root用户下,用ssh-keygen命令生成一对密钥,然后将其中的公钥,追加到远程服务器的authorized_keys文件中即可。密钥对只对本地的生成用户有效,其他用户需要重新生成并添加。命令如下:
ssh-keygen -t rsa
cat .ssh/id_rsa.pub | ssh [remote_user]@[remote_server] "cat - >>.ssh/authorized_keys"
2、修改fstab
如下添加一行:
sshfs#[remote_user]@[remote_server]:[remote_directory] [mountpoint] [mountpoint] fuse allow_other 0 0
======
参考:
sshfs挂载与ssh无密码登录
使用sshfs将全世界主机挂载到你的电脑上
http://tech.ddvip.com/2008-06/121311745245539.html
利用SSH Filesystem实现网络安全连接
http://www.cio360.net/h/1832/339601-9826.html#pager
Dokan:Windows和Linux文件共享新的途径
http://www.cnblogs.com/dengke/archive/2010/02/22/1670858.html