I've been setting up SSH and wanted to try it out, but I've run into a networking issue that I don't understand with regards to addressing. I'm wondering what a computer's address is that is assigned an IP address by a router that get's it's network IP address through a DHCP setup. For example I am working from computer A which connects to the internet via a wireless connection to a router that gets it's IP address from some ISP via a DHCP server. As far as other computers and devices that are on the same subnet are concerned my domain name is ${HOSTNAME}.local.
But, what if I want to open a secure shell, or secure ftp session with another computer, computer B, that is also behind a router that is connected to a different ISP and gets it's IP address through a DHCP server? Since the IP addresses that the routers obtain from their respective ISP's are changing and not static and the computers are assigned IP addresses that, for all intents and purposes, could be the same, how do you go about connecting to the other machine (e.g. sftp <domain name>)?
I hope I've articulated my question, and it isn't too confusing. Any help would be appreciated.
Thanks.