Score:0

Setup DNS for external ssh access to 2 different hosts on same public ip

in flag

I have 2 Raspberry Pi's running and want to be able to access them externally. I have DynDNS running to link my public IP to mydomain.com. The goal is to be able to use host1.mydomain.com to ssh into host1 and host2.mydomain.com to ssh into host2.

I was able to almost realize this by using port forwarding in my router settings but then I always needed to specify the port when connecting via ssh. Is it possible to realize this within the DNS setup?

in flag
SSH does not care about DNS, you need to use different ports if you only have one public IP. You might want try to get public IPv6 on the hosts instead.
Nikita Kipriyanov avatar
za flag
Alternatively, you can set up that using a jumphost which has direct access to both systems. Or, if one system has access to another, you can use it as jump host. But your access to that other system will depend on the first.
Bastian Hartenstein avatar
in flag
Okay, thank you both for the explanation. Will probably follow the setup with jumphost or simply add the ports manually when using SSH. If you'd post this as an answewr, I'd be happy to mark it as accepted :)
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.