How to SSH into Linode server using domain behind Cloudflare
I want to connect over SSH to my Linode ssh with my own domain.
Currently I am connecting with ssh myusername@192.0.2.1
but I want to connect with ssh myusername@mydomain.com
.
What do I need to do to make that happen?
My domain is managed on Cloudflare.
1 Reply
If your site is hosted behind Cloudflare it looks like one option is to set up a subdomain (ssh.mydomain.com for example), and disable HTTP proxying on that subdomain alone. This solution is outlined here:
Here are some other resources that may help you with setting this up:
Alternatively, if you're hoping to set this up as a way to make logging in to your server easier, you could also set up an alias in your bash profile (if using bash). For example, you could add an alias like this:
alias sshmydomain='ssh myusername@192.0.2.1'
So that if you type sshmydomain
into your terminal, it'll run the ssh command to log you in.
Lastly, there's also an option that uses cloudflared
, which is a "lightweight command line tool published by Cloudflare that will proxy traffic from your device to the server over SSH."