Linux curlftpfs--挂载FTP服务器

1、安装

   apt-get install curlftpfs

 

2、简单使用方法

  username   FTP用户名

  password:   FTP密码

  192.168.1.111:     FTP地址

  /mnt/ftp:         准备挂载到的路径

curlftpfs ftp://username:password@192.168.1.111/mnt/ftp

 

  卸载ftp:    fusermount -u /mnt/ftp

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

   sudo curlftpfs -o rw,allow_other,uid=1000,gid=1000 ftp://dewdew:dewdew@192.168.1.111/mnt/ftp

 

4、开机自动挂载

  sudo echo "curlftpfs#username:password@192.168.1.111/mnt/ftp fuseallow_other,uid=userid,gid=groupid 0 0" >> /etc/fstab

 

 

Mount FTP file system on CentOS

有SFTP后,FTP几乎没有用武之地了,研究 FTP 大多是因为某些软件或服务器只支持 FTP。

1&1独立主机附赠一个跟硬盘容量相等的 FTP 备份空间,此 FTP 只能由 root server 访问,但 1&1 并没有提供现成的备份软件(1&1营销上的失误)。FTP 备份空间对我来说用处不大,但 250 G 的空间空着也是浪费,于是我自创了我的备份方案,此中关键点是如何在 CentOS 上加载FTP 文件系统。

经一番搜索,找到curlftpfs,用它可以加载 FTP 文件系统,但 Fedora 可以直接 yum install curlftpfs,CentOS 里没有,得用 DAGrepository,所以第一步:安装 DAG repository。

rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm

第二步:安装 curlftpfs

yum install curlftpfs

第三步:没有第三步,已经可以使用curlftps 了。如果要加载 FTP 文件系统

curlftpfs ftp://ftp_host/sub_dir mount_point -ouser="ftp_username:ftp_password", uid=user_id, gid=group_id,allow_other

如果在启动时自动加载 FTP 文件系统,在/etc/fstab 中添加一行

curlftpfs#ftp_uername:ftp_password@ftp_host/sub_dirmount_point fuse rw,uid=user_id, gid=group_id,user,allow_other 0 0

(很多关于 curlftpfs infstab 的介绍使用了 noauto,这样的话,还需执行 mount mount_point 才能真正加载)

卸载 FTP 文件系统

fusermount -umount_point


  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值