I have 3 servers (server1, server2 and server3) with Apache and SCP (and/or FTP server). These servers are behind a router. I have another server with a public IP used as a proxy for Apache. So, if I'm trying to access website1 (hosted on server1) my requests are proxied to server1. The same for website2 and website3.... Now, I would like to do the same thing for FTP or SCP. Is this possible? e.g.: If I install an FTP server on server1, server2 and server3, can I proxy my requests based on the hostname? ftp.website1 to the ftp server on server1 and so on.... I can also use SCP, there is no difference, and I have full access to proxy and 3 servers.
Asked
Active
Viewed 644 times
1
-
This answers part of your question: http://serverfault.com/a/610971/214507 – kasperd Oct 02 '14 at 19:29
-
Here is another possible answer: http://serverfault.com/a/608526/214507 – kasperd Oct 02 '14 at 19:30
1 Answers
1
The easiest way to do this is to forward non-standard ports from your router to your backend servers. For example, you could configure the following on your router:
Port 10022 -> server1:22
Port 20022 -> server2:22
Port 30022 -> server3:22
Then have your end users use the appropriate port when connecting. For example:
$ sftp -P 10022 username@hostname
Doing this also has the side benefit of security through obscurity. Bots that brute force ssh rarely connect to anything other than port 22.
Gene
- 3,633
- 19
- 39