利用File Zilla在AWS的EC2虚拟机上建FTP传输文件(Win系统)

因为要下载代码但是VPN不稳定(我下的是Chromium,gclient每次断了就重来),所以曲线救国使用AWS虚拟机下载,再从虚拟机上用FTP传回本地。

总结一下希望能帮到其他朋友和以后的自己:

注册AWS之类的就不说了,现在是一年免费,只收1刀就行了。

启动虚拟机后注意保存你的pem文件,这个东西File Zilla客户端登录的时候也同样需要。

过程中基本按照两篇文章的指导在做:

Server端:

http://www.codeproject.com/Tips/404132/Amazon-AWS-Setting-up-FTP-on-EC-Windows-Instances

First, create a windows instance in Amazon AWS ManagementConsole. Once the instance is accessible, we will need to change some settings:

  1. In AWS, select “SecurityGroups” from the left-hand menu.
  2. Select the name ofthe security group for the instance you just created
  3. In the window at thebottom of the screen select the “Inbound” tab from the small frame.
  4. Pick “Custom TCP Rule”from the “Create a new rule” dropdown.
  5. Enter 50000-51000 inthe port range field.
  6. In the source field,use discretion. Leaving the field at 0.0.0.0/0 will allow all. That may be okdepending on your intended use, I’m using it as a disposable server, so I’m notgoing to get into security in this article.
  7. Select “Add Rule” andthe “Apply Rule Changes” (Make sure you do both!!!).
  8. Now repeat the steps4-7 for port 21.

We are now done setting up the security groups in AWS, let’ssetup FileZilla Server. (You can setup any type of FTP server you want, Iprefer FileZilla because it is free, rock-solid, and highly configurable. Ifyou want to use something else, just apply the same settings.

  1. Install FileZilla Serveron the Amazon Instance (after remoting in) and log into the server interface. (Youwill have to enable downloads in IE to download FileZilla from their website. )
  2. Click the settingsicon on the interface.
  3. On the generalsettings tab, “Listen on these ports:” will be defaulted to 21. Just leave it.
  4. Select the “Passivemode settings” from the tree on the left.
  5. Place a check marknext to “Use custom port range” and set the port range to “50000-51000”.
  6. Now get your “PublicDNS Name” from the Amazon AWS console. Your IP address will be in the PublicDNS Name, or you can ping the DNS name to have it resolved for you. (you may beable to use the Public DNS Name, I don’t see why it wouldn’t work, but I personallyuse the IP instead.
  7. Enter the IP into the“Use the Following IP” field on FileZilla’s “Passive mode settings” screen.
  8. Now follow theinstructions that come with FileZilla to setup a group and a user.

Now we are at the final step. You will now need to adjustthe Windows Firewall settings to allow the ports we allowed in the AWS SecurityGroup.

  1. On the instance open “WindowsFirewall with Advanced Security”.
  2. Now click on “InboundRules” on the left-hand pane.
  3. Click on “New Rule”in the right-hand pane.
  4. You should really usethe “Program” option***, but I’m going to use the port option and then clicknext.

    ***As I said before, I’m not going tocover the topic of security, I’m sure someone will tell you to never do it thisway, but this is the way I need it for the testing I’m doing.  

  5. Select TCP and the “Specificlocal ports” option and enter 50000-51000 and press next.
  6. Select “Allow theconnection” and press next.
  7. Leave all threeoptions checked and press next.
  8. Type a name for yourrule and hit finish. Then repeat these steps for port 21.

Andyou are done! Go ahead and connect with your favorite FTP client.


安装File Zilla,然后开端口,要开两部分:

1 AWS console里安全管理组的inBound端口;

2 你的虚拟机里的防火墙,我选的系统是winserver2008,在服务管理器里还挺好设的;

3 设置被动模式,地址就是你虚拟机的公网地址,你登录EC2虚拟机时候有个远程桌面,就是那个地址;


Client端:

http://www.codestore.net/store.nsf/unid/BLOG-20111012-0812

As soon as you've setup a Linux instance on Amazon EC2 you're likely next step is to get FTP access so you can move files about.

If, like me, your FTP tool of choice is FileZilla then this tip might save you some of the time it took me to work it out.

First of all make sure port 22 is open in your instance's Security Group in Amazon's AWS site. You can test this from a Terminal using the following command:

ssh Address-Of-EC2-Instance

If that times out then most likely port 22 isn't open. Otherwise you're ok. SFTP uses the same port so we can carry on and set it up.

If at this point you try to connect using SFTP from FileZilla you'll probably see this:

image

The error is "No supported authentication methods available". To get round it you need to tell FileZilla about  the .PEM file that was created when you built the Amazon instance. Assuming you already downloaded it to you PC, open FileZilla and select the Edit->Settings menu.

image

Click the "Add key file..." button and locate your PEM file. At this point FileZilla will ask if you want to convert it to a format it can use. Say yes and tell it where to put the new .PPK file. Once this is done press ok and try to connect again. You should have more luck!


按照这个教程设置的是不安全的FTP连接,所以用完就关了吧,把File Zilla服务也关了就行了。


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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值