This question already has an answer here:

I have used ssh before to login to a remote server connected via LAN.

I have two personal computers running on Ubuntu. Is it possible to connect the two using ssh so that I can login from one system to another and vice-versa? If so, how?

marked as duplicate by karel, Eric Carvalho, Pilot6, WinEunuuchs2Unix, TheWanderer Oct 23 '16 at 3:15

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


Yes, you can.

First, make sure package openssh-server is installed on both of them. Then, fire up terminal and type:

ssh username@domain-name.local - if you are on the same network or

ssh username@local-ip - same as above

or if you are connected to different networks:

ssh username@public-ip.

You can also setup password-less connection. First, generate keys using ssh-keygen (you can leave everything default).

Then, copy your public key using ssh-copy-id username@domainname.local (as above)

Repeat the process from the other machine.


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