Reputation: 634
What I am trying to achieve: sftp server.greedyguides.com
I basically want to connect a subdomain, to a load balancer that listens to port 22. I know i can ssh/sftp using the ip, but I also wanted to set up a domain version of that.
PS: I have never really asked questions on here, so sorry if format is bad.
Upvotes: 1
Views: 7295
Reputation: 1217
This is nothing different from using NLB for any other purpose There is a valid use case to use NLB for sftp servers when these servers are synchronized with NAS or EFS and clients upload files to them via sftp servers So in that case all you do is create a TCP listener on NLB port 22 and have forwarding rules for however many sftp servers you have that have NAS or EFS mounted
Think about Microservices uploading files to EFS via sftp servers using key-pair methodology for authentication for a better security (user id password security isn’t strong) Also, you don’t want all the load going to one sftp server
Upvotes: 1
Reputation: 269101
SFTP would not be an appropriate protocol to serve via a Load Balancer.
The concept of a Load Balancer is that requests are spread across targets (typically Amazon EC2 instances). Using HTTP as an example, a person might request a page and Server 1 returns the response. When they click a link and request another page, it might be served from Server 2.
However, SFTP wouldn't be happy being served by multiple computers. One computer might provide a list of available files, but when the user requests a file such a request might go to a different computer that does not have the same set of files. SFTP has not been designed as a horizontally scalable system.
From a technical perspective, an Application Load Balancer will only work with web (HTTP) requests. A Network Load Balancer might be able to serve SFTP traffic because it does not modify the content of the requests being passed to the targets.
If you wish to provide an SFTP service to your users, I would recommend AWS Transfer for SFTP:
AWS Transfer for SFTP (AWS SFTP) is a fully managed AWS service that enables you to transfer files over Secure File Transfer Protocol (SFTP), into and out of Amazon Simple Storage Service (Amazon S3) storage. SFTP is also known as Secure Shell (SSH) File Transfer Protocol. SFTP is used in data exchange workflows across different industries such as financial services, healthcare, advertising, and retail, among others.
As a managed service, AWS takes care of scaling the system, so you don't need to load balance or manage the SFTP servers.
Upvotes: 1