I have two laptops that both run on ubuntu and installed ssh server and ssh client on them. One is usually on my desk at home and one I usually bring to my company. When I'm at home I can easily ssh to one from the other by typing this command (to login to the other laptop whose IP address is: :

ssh -p 22 myusername@ 

However, When I'm at my company, I try to type the same command and ofcourse it doesn't work. I understand that when at home I'm on LAN network, that my laptops actually using my ISP's address which differ from asummed So could you tell me what IP that ssh shoud use for my laptop (at work) to connet to my computer at home?

Thank you.


port forwarding

This will be a job for port forwarding on your router at home.

You will need to redirect inbound traffic on your home router on a certain port (say 2022) to your home laptop on port 22.

Then you will be able to connect to your router on and it will be forwarded to your home laptop (

Static IP

Setting up a static IP on your home laptop will make sure that you will not get a new IP address and break the above awrup.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.