Gentoo Linux下配置FTP服务器

主机环境:Gentoo 11.2

内核版本:Linux Kernel 3.2.1

原创作品,转载请标明http://blog.csdn.net/yming0221/article/details/7360370


这里选择proftpd作为FTP服务器

1、安装proftpd

emerge -av proftpd

2、配置proftpd

首先复制/etc/proftpd/proftpd.conf.sample

cp /etc/proftpd/proftpd.conf.sample /etc/proftpd/proftpd.conf

打开该文件进行适当的修改

下面是我的文件

ServerName "yan's ftp server!"
ServerType standalone
DefaultServer on
RequireValidShell off
AuthPAM on
AuthPAMConfig ftp
RequireValidShell off

# Listen on the standard FTP port 21.
Port 21

# New directories and files should not be group or world writable.
Umask 022

# To prevent DoS attacks set the maximum number of child processes
# to 30. If you need to allow more than 30 concurrent connections
# at once simply increase this value.
MaxInstances 30

# The server will run under ftp/ftp.
User ftp
Group ftp

# Every FTP sessions is "jailed" into the user's home directory.
DefaultRoot ~

# Generally files are overwritable.
AllowOverwrite on

# Disallow the use of the SITE CHMOD command.
<Limit SITE_CHMOD>
  DenyAll
</Limit>
SystemLog                       /var/log/proftpd.syslog
TransferLog                     /var/log/proftpd.transferlog

# A basic anonymous FTP account without an upload directory.
<Anonymous /home/ftp>
  User ftp
Group ftp

# Every FTP sessions is "jailed" into the user's home directory.
DefaultRoot ~

# Generally files are overwritable.
AllowOverwrite on

# Disallow the use of the SITE CHMOD command.
<Limit SITE_CHMOD>
  DenyAll
</Limit>
SystemLog                       /var/log/proftpd.syslog
TransferLog                     /var/log/proftpd.transferlog

# A basic anonymous FTP account without an upload directory.
<Anonymous /home/ftp>
  User ftp
  Group ftp

  # Clients can login with the username "anonymous" and "ftp".
  UserAlias anonymous ftp

  # Limit the maximum number of parallel anonymous logins to 10.
  MaxClients 10

  # Prohibit the WRITE command for the anonymous users.
  <Limit WRITE>
    DenyAll
  </Limit>
  <Limit LOGIN>
    Order               deny,allow
    Allow               from all
  </Limit>
</Anonymous>


3、启动服务

/etc/proftpd/proftpd start

如果正常这样默认的FTP配置的服务器就搭建好了。


本人遇到了一个问题,就是ftp用户登录的时候总是登录失败,看了下日志

Mar 16 12:05:46 yan-laptop proftpd[15868] yan-laptop: ProFTPD 1.3.3g (maint) (built Fri Mar 16 2012 10:36:06 CST) standalone mode STARTUP
Mar 16 12:05:46 yan-laptop proftpd[15819] yan-laptop (yan-laptop[::ffff:127.0.0.1]): FTP session closed.
Mar 16 12:05:52 yan-laptop proftpd[15877] yan-laptop (yan-laptop[::ffff:127.0.0.1]): FTP session opened.
Mar 16 12:05:57 yan-laptop proftpd[15877] yan-laptop (yan-laptop[::ffff:127.0.0.1]): ftp: Directory /home/ftp/ is not accessible.
Mar 16 12:07:39 yan-laptop proftpd[15877] yan-laptop (yan-laptop[::ffff:127.0.0.1]): FTP session closed.
Mar 16 12:11:00 yan-laptop proftpd[15868] yan-laptop: ProFTPD killed (signal 15)
Mar 16 12:11:00 yan-laptop proftpd[15868] yan-laptop: ProFTPD 1.3.3g standalone mode SHUTDOWN

解决方法:

去掉aclUSE标记,重新编译proftpd安装

USE="-acl" emerge proftpd

重启服务后问题解决。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值