curlftpfs 挂载vsftp服务用户家目录

环境:centos6

机器1,nginx服务,外部访问

机器2,ftp服务,本地上传下载

安装DGArepository

1.下载rpm包:

http://www.rpmfind.net/linux/rpm2html/search.php?query=rpmforge-release 

2.找到需要的的rpm包

rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm 

可以下载最新版本这只是个例子

运行命令,开始安装 DAGrepository

rpm -Uhv rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm

3.安装curlftpfs服务

yum -y install curlftpfs

4.挂载ftp目录到本地

curlftpfs -o codepage=utf8 ftp://ftpuser:ftpuser@10.1.2.167  /usr/local/nginx/html/phone

用户或密码里有@字符可以使用 %40 代替

5.开放权限这样其它用户也能读写了,uid和gid改成你自己的id

curlftpfs –o rw,allow_other,uid=0,gid=0 ftp:// username: password @192.168.1.111 /ftp

rw,allow_other,uid=0,gid=0,umask=007 分别是 读写权限,允许其他用户操作,uid、gid(很重要,例如让 apache 或 php 或 nginx 用户拥有权限),umask是创建文件时的默认权限(可以使用默认的)。

后面的参数 ftp://'ftpuser':'ftpuser'@10.1.2.167:21 /usr/local/nginx/html/phone 分别是 固定格式ftp://'ftp用户名':'密码'@ip地址:端口号 /挂载点

6.卸载目录

fusermount -u /usr/local/html/phone
posted @ 2021-02-23 11:33  (◓3◒)  阅读(474)  评论(0)    收藏  举报