Server side

First install the ssh serever

1
sudo apt-get install openssh-server

Then look at the ip.

1
ip r 

The first ip appeared is the ip that you need to connect to.

You may need to edit the ssh server setting.

1
sudo vi /etc/ssh/sshd_config

Find the line #Port: 22, remove # and change the port number to something else i.e. Port: 80

Client side

First ping the ip to see if it can be connected.

1
ping <ip>

Then should be able to ssh to the computer directly.

1
ssh <user>@<ip>