免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 707 | 回复: 0
打印 上一主题 下一主题

RHCE Lab2: Installing and configuring FTP server [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-12-11 16:52 |只看该作者 |倒序浏览

A. Installing FTP server
#yum install vsftpd
#rpm -qa|grep -i vsftpd
#rpm -ql vsftpd
/etc/logrotate.d/vsftpd.log
/etc/pam.d/vsftpd
/etc/rc.d/init.d/vsftpd
/etc/vsftpd
/etc/vsftpd/ftpusers
/etc/vsftpd/user_list
/etc/vsftpd/vsftpd.conf
/etc/vsftpd/vsftpd_conf_migrate.sh
/usr/sbin/vsftpd
/usr/share/doc/vsftpd-2.0.5/*
/usr/share/man/man5/vsftpd.conf.5.gz
/usr/share/man/man8/vsftpd.8.gz
/var/ftp
/var/ftp/pub
B. Allow anonymous upload files
Task: allow anonymous upload file to incoming/, but could NOT download or list files from the directory.
#mkdir -p /var/ftp/incoming
#chown root.ftp /var/ftp/incoming
#chmod 730 /var/ftp/incoming
#ls -ld /var/ftp/incoming/
drwx-wx--- 2 root ftp 4096 Nov 1 03:34 /var/ftp/incoming/
Note: this results that ftp group users can ONLY upload(write) to the incoming/ folder, but could NOT list the contents of this directory or even download from it.
#vi /etc/vsftpd/vsftpd.conf
anonymous_enable=YES    # By default, YES
anon_upload_enable=YES    # Allowanonymous to upload files (by default NO)
chown_uploads=YES    # Allowed to change owner of the uploaded files from "ftp" or "anonymous" to other users
chown_username=daemon    # Change owner of the uploaded file to "daemon"
anon_umask=077    # i.e. the uploaded files with permission of 600 ( rw-------); in other means, anonymous user can NOT upload the same file twice
#service vsftpd restart
C. Testing
On FTP server:
#touch /var/ftp/incoming/server.download-incoming
#touch /var/ftp/pub/server.download-pub
On FTP client:
#touch client.upload
#ftp 192.168.75.10
Name:ftp (or anonymous)
Password: (empty)
ftp>pwd
257 "/"
* Change-rooted directory: /var/ftp
ftp>ls
drwx-wx---    2 0        50           4096 Dec 10 05:06 incoming
drwxr-xr-x    2 0        0            4096 Dec 10 05:09 pub
ftp>cd incoming
ftp>pwd
257 "/incoming"
ftp>ls
150 Here comes the directory listing.
226 Transfer done (but failed to open directory).
* Could NOT list contents of this folder.
ftp>put client.upload
150 Ok to send data.
226 File receive OK.

* Upload successfully to incoming/.
ftp>put client.upload
553 Could not create file.
* Could NOT upload the same file twice in incoming/.
ftp>get server.download-incoming
ftp>get client.upload
550 Failed to open file.
* Could NOT download files from incoming/, even the files uploaded by the anonymous user itself.
ftp>cd ..
ftp>cd pub
ftp>pwd
257 "/pub"
ftp>ls
150 Here comes the directory listing.
-rw-r--r--    1 0        0               0 Dec 10 05:19 server.download-pub
226 Directory send OK.
* Can list contents of pub/
ftp>put client.upload
553 Could not create file.
* Could NOT upload file to pub/
ftp>get server.download-pub
226 File send OK.
* Can download file from pub/


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/20003/showart_1714208.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP