浅析vsftpd服务器安装配置和将ftp地址mount映射到本地的方法

浅析vsftpd服务器安装配置和将ftp地址mount映射到本地的方法

1.安装ftp 服务器daemon程序
luther@gliethttp:~$ sudo apt-get install vsftpd
luther@gliethttp:~$ sudo mkdir -p /home/ftp_dir/upload
luther@gliethttp:~$ sudo chown ftp:ftp /home/ftp_dir/upload 供匿名用户使用的根目录
2.打开ftp服务器配置文件中anonymous匿名用户访问许可,同时追加匿名用户登录目录.
luther@gliethttp:~$ sudo vim /etc/vsftpd.conf
anonymous_enable=YES
anon_root=/home/ftp_dir
# 这样当ftp://localhost时将显示/home/ftp_dir目录中的内容,它将作为upload,download的基础目录
3. 重启ftp服务器使得修改后的/etc/vsftpd.conf配置参数生效
luther@gliethttp:~$ sudo service vsftpd restart
4.这样可以使用ftp://localhost 登录ftp服务器了
5.如果希望匿名用户可以上传文件和创建文件夹,那么需要打开如下参数
luther@gliethttp:~$ sudo vim /etc/vsftpd.conf
write_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES
# 允许匿名用户读取自己创建的目录里面的内容
anon_world_readable_only=NO
# 允许删除,重命名等操作
anon_other_write_enable=YES
luther@gliethttp:~$ sudo service vsftpd restart

那如何将ftp和smbfs一样作为文件mount到本地机呢,下面我们来看看具体实现:
1.安装curlftpfs文件系统
luther@gliethttp:~$ sudo apt-get install curlftpfs
或者
luther@gliethttp:~$ wget http://ftp.us.debian.org/debian/pool/main/c/curlftpfs/curlftpfs_0.9.1-3+b2_i386.deb
2.mount 指定ftp到本地文件中
luther@gliethttp:~$ sudo curlftpfs -o rw,allow_other ftp://172.16.32.123 /home/ubuntu/ftp
这样目录/home/ubuntu/ftp下就是firefox中 ftp://172.16.32.123浏览到的内容了
3.卸载mount到的ftp目录和卸载普通mount一样,直接sudo umount /home/ubuntu/ftp即可

( 注:
. ftp://172.16.32.123等效于ftp://anonymous@172.16.32.123
. curlftpfs标准命令如下所示:
curlftpfs ftp://username:password@192.168.1.111 /mnt/ftp
)

回目录 ubuntu专辑
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值