使用curlftpfs工具将ftp挂载到linux系统上

Linux2年前 (2022)更新 huiye
88 0

导航:本篇简单介绍如何使用curlftpfs将ftp挂载到Linux系统上

第一章:功能简介

第二章:安装curlftpfs

第三章:创建目录并挂载

第四章:设置开机自动挂载

第五章:卸载ftp

 

一、功能简介

curlftpfs可以将ftp作为硬盘挂载到linux系统上

 

二、安装curlftpfs

centos7安装方式

安装epel源:
# yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# yum clean all
# yum makecache

安装curlftpfs:
# yum install -y curlftpfs

ubuntu/debian安装方式

ubuntu:
$ sudo apt install -y curlftpfs

debian(debian默认没有sudo,使用root用户安装):
# apt install -y curlftpfs

 

三、创建目录并挂载

方式一:

# mkdir /data
# curlftpfs ftp://username:password@ip /data

方式二:

# mkdir /data
# curlftpfs ip /data -o user=username:password

参数解析:

参数
解释
username
ftp用户名
password
ftp用户密码
ip
ftp服务器地址
/data
挂载路径

 

四、设置开机自动挂载

修改配置文件,将第三步中的挂载命令添加到配置文件中

# vim /etc/rc.local
使用curlftpfs工具将ftp挂载到linux系统上

注:取消开机自动挂载,删除此行即可。若无rc.local文件,需要单独设置rc.local

 

五、卸载ftp

# fusermount -u /data

注:/data为之前设置的挂载路径

© 版权声明

相关文章