What is the name of the domain?
t******.com
What is the error message?
kex_exchange_identification: Connection closed by remote host Connection closed by UNKNOWN port 65535
What is the issue you’re encountering
cannot reach from external machine to ssh server
What steps have you taken to resolve the issue?
I set up cloudflared as described in the docs:
-
installed cloudflared on Debian
-
cloudflared tunnel login
which gave a browser url and upon completion created.cloudflared
folder. There I could seecert.pem
and a credentials json. -
created the
config.yml
:
tunnel: my-uuid
credentials-file: /home/path/to/my-uid.json
ingress:
- hostname: my-uuid.cfargotunnel.com
service: ssh://localhost:22
- service: http_status:404
did cloudflared tunnel ingress validate
and it displays: Validating rules from /path/to/config.yml OK
Then I do cloudflared tunnel start my-tunnel-name
, which starts the tunnel.
Then in another machine, I added to ssh config:
Host my-test
HostName my-uuid.cfargotunnel.com
User someuser
Port 22
IdentityFile /path/to/key
ProxyCommand cloudflared acess ssh --hostname %h
when I do ssh -vvv my-test
it says:
.....
kex_exchange_identification: Connection closed by remote host
Connection closed by UNKNOWN port 65535
This does not change if I add a CNAME
to one of the domains I own in cloudflare and replace hostname with that human friendly subdomain. This thing does not seems to work at all.
I can connect to this machine easily in the LAN, it gets the key and asks for verification etc since it has sshd running.
Ideally I just want this tunnel to forward ssh request to localhost:22 and my server still prompting for verification. I also do not want to use my domain but the automatically assigned *.cfargotunnel.com.
I must be missing something, it cant be this convoluted…
The same question has been posted on cloudflare - Cloudflared tunnel is not properly forwarding ssh - Stack Overflow
I did not create any access rules or anythign from Zero Truest Dashboard. Is that even necessary? From a technical standpoint, since the tunnel is bidirectional, cloudflare has all the information it needs to relay traffic. And even if a foreigner tries to ssh, it will get stuck on sshd’s key validation. So what am I missing?
What are the steps to reproduce the issue?
Follow the steps above