標籤:centos 使用sshfs快速搭建檔案分享權限設定服務
centos 使用sshfs快速搭建檔案分享權限設定服務 看了很多教程都寫的不夠完整所以自己根據實際操作找遇到的坑共用一下給大家
共用檔案伺服器必須開啟ssh伺服器
執行個體:IP192.168.7.50yum -y install epel-release # 安裝epel 源碼yum -y install fuse-sshfs # 安裝sshfs sshfs -o allow_other,nonempty [email protected]:/opt/ /opt/http指定密鑰檔案sshfs -o allow_other,nonempty ,IdentityFile=~/.ssh/id_rsa_storm1 [email protected]:/opt/ /opt/http開機啟動就添加映射vim /etc/fstabsshfs#[email protected]:/opt/ /opt/http fuse defaults,auto,allow_other,nonempty,IdentityFile=~/.ssh/id_rsa_storm1 0 0也可以修改/etc/ssh/ssh_config 指定ssh使用私密金鑰檔案添加 sed -i "/# Port 22/i\IdentityFile ~\/.ssh\/id_rsa_storm1" /etc/ssh/ssh_config ssh 密鑰產生 ssh-keygen輸入:id_rsa_storm1copy 公開金鑰到遠程伺服器ssh-copy-id -i [email protected] 注意:如果要使用web服務能夠訪問共用目錄一定要添加allow_other 參數
本文出自 “成長記錄” 部落格,請務必保留此出處http://juestnow.blog.51cto.com/1515305/1878984
centos 使用sshfs快速搭建檔案分享權限設定服務