0
I am fairly new to studying networking, and this is something I have been wondering even though it may be a basic question. I've spoken with people in the networking world and they talk about having to remotely connect (via Telnet or SSH) to devices in order to look at configurations and make changes. In my studies I have also fiddled around with remote connections, but never across a WAN or connecting to a device in another network.
Let's say you have two office branches located in different states, they are not connected via leased lines and instead route traffic over the internet in order to communicate with each other. Let's say within Branch A there is a Cisco switch you need to connect to from Branch B. The switch has a private IP address of 192.168.1.50 /24. Since this is a private address, and not unique in any way, how does the person at Branch B initiate a telnet or SSH connection to the device?
Now I know a bit about NAT and PAT, but not a lot. I understand with PAT, if a device wants to communicate with say a web server across the internet, its private address is translated to a public/routable IP and uses port numbers to identify the session. This makes sense because the web server can see who to reply to. But in the case of my telnet example, how is the user in Branch B able to find the exact device in Branch A when the device is configured with a private address?
I'm sorry if this is very basic, I'm trying to better understand the concepts here but am having a hard time with this one. This could apply to multiple protocols, not just SSH or Telnet, but I'm just using them as an example.