centos 使用sshfs快速搭建文件共享服务

centos 使用sshfs快速搭建文件共享服务 看了很多教程都写的不够完整所以自己根据实际操作找遇到的坑共享一下给大家

共享文件服务器必须打开ssh服务器

实例:IP192.168.7.50
yum-yinstallepel-release#安装epel源码
yum-yinstallfuse-sshfs#安装sshfs
sshfs-oallow_other,nonemptyroot@192.168.7.205:/opt//opt/http
指定密钥文件
sshfs-oallow_other,nonempty,IdentityFile=~/.ssh/id_rsa_storm1root@192.168.7.205:/opt//opt/http
开机启动就添加映射
vim/etc/fstab
sshfs#root@192.168.7.205:/opt//opt/httpfusedefaults,auto,allow_other,IdentityFile=~/.ssh/id_rsa_storm100
也可以修改/etc/ssh/ssh_config指定ssh使用私钥文件
添加sed-i"/#Port22/i\IdentityFile~\/.ssh\/id_rsa_storm1"/etc/ssh/ssh_config
ssh密钥生成
ssh-keygen
输入:id_rsa_storm1
copy公钥到远程服务器
ssh-copy-id-iroot@192.168.7.25
注意:如果要使用web服务能够访问共用目录一定要添加allow_other参数

相关文章

Centos下搭建性能监控Spotlight
CentOS 6.3下Strongswan搭建IPSec VPN
在CentOS6.5上安装Skype与QQ
阿里云基于centos6.5主机VPN配置
CentOS 6.3下配置multipah
CentOS安装、配置APR和tomcat-native