惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

美团技术团队
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Martin Fowler
Martin Fowler
雷峰网
雷峰网
IT之家
IT之家
小众软件
小众软件
M
MIT News - Artificial intelligence
博客园 - 聂微东
J
Java Code Geeks
Blog — PlanetScale
Blog — PlanetScale
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
A
About on SuperTechFans
G
Google Developers Blog
Engineering at Meta
Engineering at Meta
Recent Announcements
Recent Announcements
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The GitHub Blog
The GitHub Blog
F
Fortinet All Blogs
C
Check Point Blog
云风的 BLOG
云风的 BLOG
腾讯CDC
H
Help Net Security
Y
Y Combinator Blog
I
InfoQ

博客园 - liudao

SqlAzureDatabaseSchemaProvider错误的解决 Azure Blob实战之——从客户端到FTP 将数据库迁移到SQL Azure的三种方式(转) 客户应该知道的软件开发八个原则(转) 翻译:Asp.net中多彩下拉框的实现 MyWebPagesStarterKit1.1.2汉化使用心得(同时分享汉化版源码) 微软Web Camps活动照片(北京站) 开机出现文件windows root\system32\ntoskrnl.exe的另类解决办法 - liudao - 博客园 Sql2005数据库为什么要放到App_Data下? 走出软件作坊:三五个人十来条枪 如何成为开发正规军(二) 三五个人十来条枪 如何走出软件作坊成为开发正规军(转) 商业计划书最好就是十页篇幅 十四个ASP.NET基础知识问答(C#版) VS中常见的扩展名,看看你知道几个? VS2008简体中文版下载(及升级为正式版办法,见截图) 微软2008(英雄)大会归来有感 写给毕业生朋友:是骡子是马拉出来溜溜! 春节必看的五个Asp.net源码! BugNet0.7.881.0汉化免安装版源码(后续版本不断汉化更新中,敬请期待!)
在Windows Azure虚拟机中部署FileZilla (no coding)
liudao · 2013-03-22 · via 博客园 - liudao

Once you’ve setup a virtual machine in windows azure, you are likely need to transfer files between your local machine and the virtual machine in the cloud. You may need to upload software, tools or even database files to the VM.

The most convenient way to do that is to have a FTP server on the VM, so you can do uploading and downloading from anywhere.

However, set up a FTP server in the cloud is not as easy as it looks like. The key challenge is that FTP sessions need to establish two connections to transfer a file:

  • Control connection. Used to send control between server and client. Established when client connect to server on port 21;
  • Data connection. Used to transfer files. In active mode, client randomly picks a port and server will make the connection; in passive mode, server randomly picks a port, and client makes the connection.

As you know, VM does not have public IP address, to make the virtual machine accessible from outside of cloud, you need to create an endpoint for each port you want to connect, to forward the port from public gateway to your VM.

That means, if you want to connect to port 21 of the VM, you need to create an endpoint in the windows azure portal, to forward port 21 to vm’s port 21. That’s relative easy, what’s difficult is the data channel, because we don’t know the exact ports beforehand.

So we have to limit the ports that FTP server uses for data channel to a small range, and for each port in the range, create an endpoint, so that client and server can establish the data connection.

Also, don’t forget firewall. Make sure the firewall on the server allows connection on the ports (21 and ports for data channel).

Below are the detailed steps (by default the actions are done on windows azure virtual machine, not your local machine):

1, Download FileZilla server from http://filezilla-project.org/download.php?type=server;

2, Install FileZilla server, accept all the default options;

3, Add a user

3.1 Launch FileZilla Server interface;

3.2 go to menu Edit->Users;

3.3 Click the Add button in the users group on the right side;

3.4 Select Shared folders in the Page group, on the left;

3.5 In the Shared folders, click the Add button, select a folder that ftp user can access;

3.6 Click OK to close the dialog;

More info http://wiki.uniformserver.com/index.php/FileZilla_Server:_Basic_Configuration

Now you should be able connect to the FTP server from within the Virtual Machine, use the user you just created.   But it’s not accessible outside of the VM, like from your desktop.

4, Configure firewall to allow “FileZilla Server.exe”, not “FileZilla Server Interface.exe”, through;

5, Configure your virtual machine to allow ftp connection

5.1 Go to your windowsazure.com portal;

5.2 Select your virtual machine, and click ENDPOINTS on the top;

5.3 Click ADD ENDPOINT button on the bottom;

5.4 Put following parameter in to popped dialog

NAME:<whatever you want>

PROTOCAL:TCP

PUBLIC PORT:21

PRIVATE PORT:21

More info http://www.windowsazure.com/en-us/manage/windows/how-to-guides/setup-endpoints/

Now you should able to log in to the FTP server from anywhere, but still unable to retrieve directory listing, because you can’t establish the data connection.

6, Configure data channel port in FileZilla server

6.1 Launch FileZilla Server Interface;

6.2 Go to menu Edit->Setting;

6.3 Select Passive mode setting on the left

6.4 check “Use custom port range”, and input a port number greater than 1024 for both low and high number, let’s say put 60000. (Limit the port range because we don’t want to create hundreds or thousands of ENDPOINT in windowsazure portal);

6.5 Click OK to close the dialog;

7, Configure firewall to allow inbound connection from the port Configured in step 6;

8, Add another ENDPOINT in the windowsazure portal for the data channel port you configured in step 6, parameters:

NAME:<whatever you want>

PROTOCAL:TCP

PUBLIC PORT:60000

PRIVATE PORT:60000

9, In the IPv4 specific group, select Retrieve external IP address from:

filezilla_passive_setting

filezilla_passive_setting

Done!

Note: windows command line ftp.exe does not support passive mode, so recommend FileZilla client to connect from outside of the virtual machine.

原文地址:http://huberyy.wordpress.com/2012/08/03/set-up-a-ftp-server-in-windows-azure-virtual-machine-with-filezilla-no-coding/