Second FTP Server On Subdomain

1

1

I've my own domain name that I'm trying to set up with two FTP servers. (I have two totally independent FTP servers I want to be able to access.) I set one to run on the standard port, 21, and the other to run on some higher port, 1050. Ideally, what I'd like is that someone types:

ftp://server1.mydomain.com

And that goes to the FTP server at port 21.

And I like that when someone types: ftp://server2.mydomain.com That forwards to 1050, and the person ends up connecting to the second FTP server.

Currently what I have is:

http://server1.mydomain.com -> FTP server on port 21

and

http://server2.mydomain.com -> FTP server on port 1050

I tried create a cname to that links ftp://server2.mydomain.com to ftp://mydomain.com:1050 but that didn't work.

Help appreciated.

Thanks.

Jean-Luc

Posted 2014-04-12T01:35:40.517

Reputation: 113

Question was closed 2014-04-16T16:17:08.853

Answers

1

Can't be done in DNS as DNS had no concept of ports and FTP had no concept of hosts.

You could do it by binding each FTP server to a separate address if you have multiple. If not, thing get complex. Theoretically You might be able to run a sort of ftp proxy to forward based on login credentials (but then why not just configure 1 ftp server) or hack something based on source IP, again, probably not practical.

davidgo

Posted 2014-04-12T01:35:40.517

Reputation: 49 152

Thank you for the advice. How do people normally deal with setting up two FTPs on the one host? I was hoping there'd be some port-forwarding options... – Jean-Luc – 2014-04-12T07:21:43.743

As far as I am aware they don't. They use 1 FTP server and configure the available resources based on username. There really arnt port forwarding options assuming you use a home router with only a single address. If I may ask, why do you believe you need 2 servers anyway - and is it on 1 host or on 2 hosts behind NAT ? – davidgo – 2014-04-12T07:33:37.337

Okay, thanks for that information. I'm behind a home router, and basically, I have a router with a HDD attached to it, and the router does FTP. I also have a network harddrive box which does FTP. I'm not really sure how I could use 1 FTP server really, since they're both independent entities. I'm surprised this kind of thing doesn't come up more often... – Jean-Luc – 2014-04-12T08:05:27.480

You can't use FTP for both directly from the wider Internet (this problem actually comes up quite often in various forms). What you may be able to do (depending on the router or other resources) is set up a VPN into your network so that you can use the Internal addresses to access your devices real IP's - this provides much more security as well. Alternatively you may want to look at another protocol - you will probably find that the network harddrive supports SMB (ie Windows Filesharing) and/or NFS. You could thus use FTP for the router but do forwarding of NFS or SMB ports...cont – davidgo – 2014-04-12T08:14:14.747

to the NAS. In either event, you should be very aware that none of these protocols is secure (ie they all transmit the data unencrypted over the wire, and in some cases the password as well) - A VPN will help that. Another less common alternative - if the NAS supports it is to use SFTP or SCP. These protocols run over SSH and are way more secure. They are also MUCH easier to forward then FTP (FTP is a horrible, horrible protocol) – davidgo – 2014-04-12T08:16:11.480

Thank you for the advice. To be honest, I'm not really that good at this stuff yet, still learning, but I might implement something like this in the future. I actually was thinking SFTP (I have an SSH server going to on something else). Unfortunately, the stupid box doesn't support SFTP. I like SSH/SFTP :) Learning about this stuff, I'm actually quite unimpressed about how unsecure certain aspects of this sort of thing is. – Jean-Luc – 2014-04-12T08:26:43.073

Would a solution be to create a 'shortcut' to place a shortcut on the router drive pointing to the NAS box? I don't really know if this even makes sense to be honest. – Jean-Luc – 2014-04-12T15:35:53.477

I highly doubt this is doable with off-the-shelf appliances, but if you are somehow able to "unify the space" so it all appears as a disk you could do it. – davidgo – 2014-04-12T19:28:38.633

On Linux, I can mount a network drive to a folder, I think I'll mount all my drives to different folders, and put all those folders in an SFTP folder. Thanks for the help. – Jean-Luc – 2014-04-13T09:42:11.767