Close SSH connection

Solution 1:

On the terminal window, you'll simply need to type "exit". It looks like this;

[username@mail0 ~]$ exit
logout
Connection to [IPADDRESS] closed.

Solution 2:

When I'm on a remote server via ssh this often wont give the desired result. Especially when working with screen remote on a session that I want to continue some time later. Exit would close the screen session. What works instead is to these three buttons / characters in a row:

Enter ~ . 

(including the period at the end)

Solution 3:

Just close the window or press Ctrl-D, which will terminate the session.