Categorized | 推荐阅读, 网络技术

Tags |

Amazon EC2的Proftpd配置

发布于 2013年08月29日 更新于 2013年08月30日 

在Amazon EC2上安装Proftpd会出现FTP无法连接的情况,明明开放了端口还是连不上,这是因为ec2的主机在内网,需要使用FTP的passive被动模式连接及添加MasqueradeAddress地址才行。

操作步骤:

1、首先给实例绑定一个固定IP(Elastic IP address)。

2、给“Security group”防火墙里,开发FTP的端口,默认为21端口,可自定义。

3、修改Proftpd的配置文件,比如我的配置文件位置在,/usr/local/proftpd/etc/proftpd.conf,你的如果找不到可以搜索一下,然后修改proftpd.conf里面的port端口,此时还需要在端口下添加两行内容,分别为PassivePorts 49152 65535(被动连接端口),MasqueradeAddress  your_elastic_ip_address,最后保存后重启proftpd,命令为/etc/init.d/proftpd restart,这样FTP就可以连接上了!

4、别忘了,给你的ftp上传目录,添加ftp用户的所有者权限,如 chown -R simonvps:simonvps /usr/local/simonftp,否则你的ftp即使连接上了,也是无法上传的,切记!

使用chown()请谨慎些,不要对根目录以及包含ssh的目录使用此操作,貌似会令系统奔溃,我对ssh目录使用后,ssh就登陆不上了。。。需要改回来,反正需要注意才行!

我的示例代码为:


ServerName "ProFTPD FTP Server"
ServerType standalone
DefaultServer on

# Port 21 is the standard FTP port.
Port 21
PassivePorts 49152 65535
MasqueradeAddress xx.xx.xx.xx

# Don't use IPv6 support by default.
UseIPv6 off

# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and 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. Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd).
MaxInstances 30

# Set the user and group under which the server will run.
User simonftp
Group simonftp

# To cause every FTP user to be "jailed" (chrooted) into their home
# directory, uncomment this line.

附注:proftpd.conf里面的user和group是需要修改的,默认为nouser和nogroup,都改成你的ftp用户名即可。

如有问题,可留言!

看了此文的人貌似还看了这些:

  • Amazon EC2的Proftpd连接不上? 2013-08-25
  • 斗牛http状态码批量查询工具 V3.0(支持多级查询,全网首发URL跳转次数、跳转情况查询、首次/最终着陆页查询) 2013-10-03
  • 斗牛百度指数批量查询工具V3.3(支持多关键词批量查询、多账号cookies提取功能等等) 2014-01-02
  • SEO中的canonical标签如何使用? 2012-06-22
  • 斗牛百度商情长尾词拓展工具V3.0(支持万级量的数据查询) 2013-12-26
  • 新浪SAE中文分词接口 2014-01-24
  • wordpress换空间实录,让windows的iis也支持去固定链接index.php化! 2011-02-21
  • 百度六七月份算法已升级,SEO该如何应对相应策略? 2012-07-06
  • 斗牛SERP标题描述预览工具V2.0(一键生成title描述预览,标题写的好不好,预览先知道) 2013-10-22
  • ☆大型网站海量关键词优化策略 2012-05-31
  • 发表评论

    Time limit is exhausted. Please reload CAPTCHA.

       我相信你,不会发广告!

    斗牛SEO工具