How to set up SSH/SFTP subdomain?

June 15, 2018 120 views
DigitalOcean Ubuntu 16.04

I currently connect to my droplets via SSH and SFTP by specifying the droplet's IP address and port 22 in the SSH/SFTP client programs. This works fine, but I would like to be able to specify a domain or subdomain (e.g., ftp.example.com) rather than an IP address. Managed hosts I've used in the past provided me with a subdomain for that purpose, but I have not been able to find out how to set that up on my droplets. Can someone give me some pointers?

2 Answers

Well, You would need your own domain, Once you have your domain, in your domain registrar's domain settings you can set up an A record and point that to your droplet's IP Address.

  • That would imply my existing A record for the naked domain should work too, but it doesn't (the server doesn't respond), so I think it must be a bit more to it than that, thus my question.

You may need to wait for DNS to update. A record is all there is to point a subdomain to a server so I am not sure what is causing your problem other than your registrar being slow to update their DNS or your DNS server not updating their records.

  • Ok, thanks for your response. The A record has been in place and working for years, but I gather from your response there is nothing special that needs to be done to get FTP working through DNS. I'll check to see if Cloudflare is blocking port 22, or something along that line.

Have another answer? Share your knowledge.