So I made a picture to illustrate our current state and help the explanation.
"A" is the computer at home, "B" is the computer at work, "C" is another computer at work.
"C" does have access to "B".
"A" does not have access to "B" and this is our problem that has to be solved.
The most common reason for this is that "B" and "C" are in the same network, "A" has to get trough the router to be able to access "B" or "C".
"B" and "C" has local IP addresses lets say for example
192.168.13.10 for "B" and
192.168.13.20 for "C". The router also has his own IP addresses one internal (ex.
192.168.13.1) and one external (ex.
10.10.10.11) that can be reached over the internet.
"B" and "C" can talk to each other with ease by calling each other over the local IP address, since they are in the same network if "C" wants to talk to "B" over port 22 all he has to do is open communication on
It gets a bit more complicated when "A" wants to reach "B" or "C", since there is only one IP address that can be accessed over the internet, and that is the routers external IP address:
What happens here is, there has to be a port forwarding on the router meaning that, lets say we want to forward all the information that the router gets on port
12345 to the port 22 of "C". So we must set up the routers port forwarding saying that inbound connection on port
12345 to be forwarded to
192.168.13.20:22 (address of computer "C")
From now on, if I want to access the port 22 of computer "C" from an external computer, I just have to connect to
so in order for this to work and to be able to access computer "B" from computer "A", we must have a port forwarding in the router on a free port that refers to the internal address of computer "B"s port 22.