电信主站 网通分站
购买流程 付款方式 常见问题 在线提问 续租服务 购物车
用户名: 密 码: 忘记密码?
首 页
域名注册
虚拟主机
双线主机
服务器租用
VPS主机
企业邮局
代理专区
客服中心
虚拟主机行业资讯 虚拟主机评测对比 互联网最新动态 技术学院 站长资讯 在线教程 网站运营
搜索优化 服务器 网络编程 图形图象 站长之家 网页制作 操作系统
冲浪宝典 软件教学 视频通信 办公软件 邮件系统 网络安全 认证考试
您当前位置:西部数码->资讯中心-> 网络编程
FreeBSD上面的Proftpd安装与配置
作者:未知 点击:0
  西部数码-全国虚拟主机10强!20余项虚拟主机管理功能,全国领先!第6代双线路虚拟主机,南北访问畅通无阻!虚拟主机可在线rar解压,自动数据恢复设置虚拟目录等.虚拟主机免费赠送访问统计,企业邮局.Cn域名注册10元/年,自助建站480元起,免费试用7天,满意再付款!P4主机租用799元/月.月付免压金!
文章页数:[1] 
 1. 安装proftpd1
------------------
shell> tar zxvf proftpd-1.2.10.tar.gz
shell> cd proftpd-1.2.10
shell> ./configure --prefix=/usr/local/proftpd
shell> make
shell> make install
2. 创建ftpassswd命令
------------------------
从 http://www.castaglia.org/proftpd/contrib/ftpasswd 获得ftpasswd的perl源代码,
并保存为 /usr/local/proftpd/sbin/ftpasswd 。
shell> chmod 755 /usr/local/proftpd/sbin/ftpasswd
通过ftpasswd命令,可以对ProFTPD的虚拟用户进行管理。
shell> echo "wheel:*:0:" >> /usr/local/proftpd/etc/ftpd.group

shell> /usr/local/proftpd/sbin/ftpasswd --passwd --name=admin --uid=2001 --gid=0 --home=/ftp/admin --shell=/bin/bash --file=/usr/local/proftpd/etc/ftpd.passwd
...
Password: <new password>
Re-type password: <new password>

shell> /usr/local/proftpd/sbin/ftpasswd --passwd --name=tom --uid=2101 --gid=2000 --home=/ftp/tom --shell=/usr/sbin/nologin --file=/usr/local/proftpd/etc/ftpd.passwd
...
Password: <new password>
Re-type password: <new password>

之后会自动生成/usr/local/proftpd/etc/ftpd.passwd

shell> chmod -R 777 /ftp/admin
shell> chmod -R 777 /ftp/tom
要注意,因为虚拟用户并不在本地系统用户中存在,所以要设置虚拟用户可以访问的所有目录都允许其它用户写,这样才能保证虚拟用户正常增删文件。
3. 接下来配置proftpd.conf
-----------------------------

shell> vi /usr/local/proftpd/etc/proftpd.conf

ServerName "My FTP Server"
ServerType standalone
DefaultServer on

Bind 10.210.66.130
ExtendedLog /var/log/proftpd read,write,auth
# 原来的设置项是ScoreboardPath,但现在版本的proftpd已不再支持,改用ScoreboardFile
ScoreboardFile /usr/local/proftpd/var/proftpd/proftpd.scoreboard

Port 21
Umask 022

MaxInstances 50
MaxClients 20
# 如果允许匿名访问或多人共用同一帐号,MaxHostsPerUser和MaxClientsPerUser不应设置过小,或不用设置
MaxClientsPerHost 3 "Sorry, only 3 connections allowed per user!"
MaxHostsPerUser 1 "Sorry, only 1 host allowed per user!"
MaxClientsPerUser 1 "Sorry, only 1 connection allowed per user!"
TimeoutIdle 600
TimeoutStalled 10

# 不显示服务器相关信息, 如proftpd版本
ServerIdent off
# 禁用反向域名解析
UseReverseDNS off

# 支持FXP
AllowForeignAddress on
# 支持被动模式
PassivePorts 49152 65534

AllowOverwrite on
# 允许下载续传,默认即开启,但为了明确我显示地声明
AllowRetrieveRestart on
# 允许上载续传
AllowStoreRestart on

DisplayLogin welcome.msg
DisplayFirstChdir .message

User nobody
Group nogroup
# 不要求有合法shell,直接效果是允许nologin用户和虚拟用户登录
RequireValidShell off
# 设置用户验证顺序是先虚拟用户再本地用户
AuthOrder mod_auth_file.c mod_auth_unix.c
# 指定虚拟用户数据文件
AuthUserFile /usr/local/proftpd/etc/ftpd.passwd
# 指定虚拟组数据文件
AuthGroupFile /usr/local/proftpd/etc/ftpd.group
# ***除wheel组外其它所有组只能访问home目录内容,这里wheel需要在ftpd.group中定义
DefaultRoot ~ !wheel
# 虽然默认情况root不能ftp,但我仍然显式地声明它,也方便随时开启这个功能。
RootLogin off
<Limit SITE_CHMOD>
DenyAll
</Limit>
<Anonymous ~ftp>
User ftp
Group ftp

# We want clients to be able to login with "anonymous" as well as "ftp"
UserAlias anonymous ftp

# Limit the maximum number of anonymous logins,禁用匿名FTP
MaxClients none "Sorry, anonymous is refused on this site!"

# We want 'welcome.msg' displayed at login, and '.message' displayed
# in each newly chdired directory.
DisplayLogin welcome.msg
DisplayFirstChdir .message

# Limit WRITE everywhere in the anonymous chroot
<Limit WRITE>
DenyAll
</Limit>
</Anonymous>
4. 启动proftpd
-------------------
shell> /usr/local/proftpd/sbin/proftpd

OK,到这里,我们的proftpd架设的ftp服务器就可以正常使用了。

现在用户tom拥有home目录的所有权限,但不能访问home以外的目录;
用户admin除了拥有home目录的所有权限之外,还可以访问home以外的目录,对这些目录的操作权限依赖于文件系统对目录的权限设置;
与其同时,本地系统用户(虚拟用户中无重名)也可以验证通过访问ftp。
5. 配置自动运行
-------------------
shell> echo "/usr/local/proftpd/sbin/proftpd" >> /etc/rc.local
6. 禁用匿名FTP
------------------

方法一:
<Anonymous ~ftp>
...
MaxClients None "Sorry, Anonymos is refused on this site!"
...
</Anonymous>


方法二:
<Anonymous ~ftp>
...
<Limit LOGIN>
DenyAll
</Limit>

...
</Anonymous>

当然,用Limit ALL也是可以的。

方法三:
直接删除<Anonymous ~ftp>...</Anonymous>部分就可以了。

文章整理:西部数码--专业提供域名注册虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!
相关主题
文章页数:[1] 
Google
热门文章
·ASP教程:第五篇 脚本变量、函数、过程和条件语句
·ASP教程:第十八篇 堵住ASP漏洞
· ASP教程:第十七篇 ADO 存取数据库时如何分页显示
·ASP教程:第十六篇 其它的ASP常用组件
· ASP教程:。
·ASP教程:第十四篇 ActiveX 组件
· ASP教程:第十三篇 数据库查询语言(2)
·ASP教程:第十二篇 数据库查询语言(1)
· ASP教程:第十一篇 ASP内建对象Server
·ASP教程:第十篇 Global.asa文件的使用及Chat程序

最新文章
·FreeBSD上面的Proftpd安装与配置
·用Sendmail在Linux下架设邮件服务器
·Linux操作系统中如何安装MySQL数据库
·WinXP+Mac OS X+Linux的多操作系统安装
·Linux和Windows共存的模式下分区要小心
·Linux系统下的C语言开发都需要学些什么
·Linux操作系统中安装JAVA JDK1.6的方法
·Linux操作系统程序启动引导过程详细剖析
·Linux操作系统Vim/Vi编程提速
·用户认证功能的SQUID代理服务器


 
 


版权申明:本站文章均来自网络,如有侵权,请联系我们,我们收到后立即删除,谢谢!

特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有。
  打印  刷新  关闭
返回首页 |关于我们 | 联系我们 | 付款方式 | 创业联盟 | 虚拟主机 | 资讯中心 | 友情链接 | 网站地图

版权所有 西部数码(www.west263.com)
CopyRight (c) 2002~2006 west263.com all right reserved.
公司地址:四川成都市万和路90号天象大厦4楼 邮编:610031
电话总机:028-86262244 86263048 86263408 86263960 86264018 86267838
售前咨询:总机转201 202 203 204 206 208
售后服务:总机转211 212 213 214
财务咨询:总机转224 223 传真:028-86264041 财务QQ:点击发送消息给对方635483282
售前咨询QQ:点击发送消息给对方2182518 点击发送消息给对方241975952 点击发送消息给对方275026793 点击发送消息给对方408235859
售后服务QQ:点击发送消息给对方17708515 点击发送消息给对方307742704 点击发送消息给对方287976517 点击发送消息给对方363783715
《中华人民共和国增值电信业务经营许可证》编号:川B2-20030065号