HowTo:PrivateFTP
From Wiki
|
Contents |
My first private FTP
n00b's journall on creating FTP
Introduction
I had this idea to set up my own FTP for a long time but never had time, knowledge or enough will to do it.
As google is full of tutorials and howTos I decided to create one, just for fun.
Few minutes later I was in the land of FTP tutorials, finding myself in situation where one can't see the forest from all the trees around.
So where to look...hm
The best place I could think of was IRC. And I was right! #wareznet.chat..............!!
I allready knew that for FTP server I must have some software so the question was:
Can someone advise me a good, small, FTP server app - not IIS from windows, something nice
Right on I got an answer...Gene6 (thx Eclipse)
Hello World
I've searched WarezNet and find this sofware Gene6 FTP server version 3.0.2, download and install it, still not knowing anything about FTPs.
On first run Gene6's wizard asked me to 'setup a new remote FTP server to administer'. Aha, that's what I want.
Name: Local machine
Description: Local FTP server administration
User:Administrator
Password:0000
Host: ?????
Port: ?????
what's this?
First obesticle!
I will host this FTP, so host should be me/mine IP address.
But my IP address is changing once a day (it's dynamic) and I'm behind a router/firewall ???
And what the hell is that port ??
Closing Gene6 :(
IP addresses everywhere
First I wanted to find out my current IP address. I've find out that I actually have three of them:
- First one is my local IP address wich is assigned to my computer by my router.
- Second one is my router's local IP address.
- Third one is my public IP address which is assigned to my router by ISP provider.
To find out IP address assigned to my computer I've opened Command Prompt (start -> Run -> type: CMD -> enter)
and typed ipconfig -> enter.
And there it was, my computer's local IP address:
IPv4 Address ...........: 192.168.1.2
also I've noticed 'default gateway' from/to wich all data is flowing, so that must be my router's local IP address, ha!
Default Gateway ........: 192.168.1.1
Thank you. Closing.
Hm, the third IP address was still a mistery, and the answer could give me mr. router.
Router's torture
I have D-link router, but all routers are simillar. I will point you where to look.
I've opened IE and typed my 'Default Gateway' IP address (http://192.168.1.1)
As I've suspected there was my router saying welcome... khm, morelikely saying 'give me user name and password'.
Solution for this problem I found in router's documents, and after that I was logged as Admin.
Under status I've found my public IP address, mistery solved.
There is a nice page called yougetsignal that gives you info about your IP, ports, etc.
Also there was one thing that I've seen google talks about...
Port filtering (technically: Router's catharsis)
Imagine your public IP address as real world address and your router as a house with thousands of doors.
To enable FTP data to come and go you must open one of these doors, but wich one?
Luckily there is a standard for FTP and it says that FTP data should knock on door number 21.
So we should all use port 21...NO!
Why?
Because it's standard for FTP, your ISP knows that too and will probably listen for traffic on that port.
If you have something more ilegal than it should be, then suggestion is port 23 or port 25.
It is important to note that some ports, such as port 25, are often blocked at the ISP level in an attempt
to prevent malicious activity.
Well, for testing 21 will do. :)
For this step you will need to find out how to filter ports on your router and here you should be able to find it
Under port filtering I choosed computer's local IP address (192.168.1.2) and then choosed
- port start...21
- port end....21
- port mask..21
What I actually did was informing my router, when data comes to port 21
it must be redirected to my computer and vice versa.
Uh, one more annoying thing, FTP PASV mode.
This is like Ping?Pong! between client and server (when in passive mode), and to allow this, one more port must be opened.
So back to port filtering.
As stated in Gene6 documentation it's best to use port from 50000 to 50100.
Under port filtering I choosed my computer's local IP address (192.168.1.2) and then choosed
- port start...50000
- port end....50100
- port map...50000
Finally...Save...Reboot router.
Dirty Work is over, back to Gene6.
Gene6 settings
Name: Local machine
Description: Local FTP server administration
User:Administrator
Password:0000
Host: 192.168.1.2 <- my computers local IP address
Port: 8021 <- this is port 21
OK
Now an easy work. Setting up a domain. Right click on Domains or just double click in right window to open Domain wizard, wich will guide to the rest of process.
In beginning of this text I said that I don't have static IP, also I don't have a domain name.
You can set up your dynamic domains for free on http://www.dyndns.org or http://www.no-ip.com
For testing purpose it doesn't metter what you will enter in this box 'cause server will work if accessed with public IP.
Due to my connection limits I will limit max users to 5 and each user can log from only one IP address.
Hm, I'm not setting up SSL connection so...Next, something about logs...Next.
Create Anonymous account, I suggest no, but this can be changed later easilly.
In Domain settings go to IP binding (under Secure) and under 'Redirect PASV IP' enter your computer local IP address
and as stated before under 'Passive port range' enter 50000 to 50100 <- this is why I had to open new port on my router.
That's it. Works?
Well, for me, uhm, no?!
I've set everything up, learn and google for couple of hours, and finally did everything
like in this tutorial, but still I was scratching my head for 2 days 'cause nothing worked as suppose to.
Day First
As a nOOb I forgot to make an exception in windows firewall for port 21 (TCP).
Still nothing happend. :'(
Day Second
Finally I was back on IRC asking Hashi to help me test it 'cause I don't know what's wrong.
And he successfully did it, and was my first FTP user ever.
Erm....actually my FTP was working for the whole time, only I could't connect to it from same public IP. ROFL
Created by Djtripoli on 19.11.2007
Link references
- http://www.g6ftpserver.com Creators of this great app
- http://www.yougetsignal.com/openPortsTool/ Your current IP, opened/closed ports, location
- http://portforward.com/routers.htm Settings for almost all known routers
- http://www.dyndns.org/ Dynamic domain provider
- http://www.no-ip.com/ Dynamic domain provider

