1.配置好yum源
2.安装必要的依赖包
yum install glib2-devel
yum install fuse-devel
yum install libcurl-devel
3.下载Curlftpfs的包
wget http://sourceforge.net/projects/curlftpfs/files/latest/download
4.解压安装
tar xvzf curlftpfs-0.9.2.tar.gz
cd curlftpfs-0.9.2
./configure
make
make install
5.创建映射目录
mkdir /mnt/test
6.定义ftp映射挂载
curlftpfs ftp://ftp_username:ftp_password@FTP_URL:FTP_PORT /mnt/test
7.这样就完成了到ftp的挂载
Linux下用curlftpfs挂载FTP服务器
1. Fedora可以直接yum install curlftpfs,CentOS不行,得用DAG repository,所以得先安装DAG repository。在rpm官网去搜索rpmforge-release并下载长传至linux上;
2. 执行如下命令进行安装:rpm -Uhv rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
3. 安装curlftpfs:yum install curlftpfs
4. 挂载FTP服务器
curlftpfs -o codepage=utf8 ftp://username:password@192.168.192.168 /ftp
curlftpfs -o rw,allow_other ftp://centos:cloud4c@192.168.17.195 /home/centos/ftp
curlftpfs -o rw,allow_other ftp://192.168.17.195 /home/centos/ftp
5. 开机自动挂载
echo "curlftpfs#username:password@192.168.1.111 /ftp fuse allow_other,uid=0,gid=0 0 0" >> /etc/fstab
6. 卸载挂载
fusermount -u /ftp