Close SSH connection

17

5

I'm using Mac's Terminal App and I know how to connect to an external server via ssh (ssh -l username domain.com). But how do I close the connection once I'm done? Thanks.

Hope4You

Posted 2012-02-09T18:11:12.463

Reputation:

Answers

36

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

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

Ethabelle

Posted 2012-02-09T18:11:12.463

Reputation: 910

10

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)

s.Daniel

Posted 2012-02-09T18:11:12.463

Reputation: 205

8

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

Sven

Posted 2012-02-09T18:11:12.463

Reputation: 1 591