How can I logout an open remote SSH session

How can I logout an open remote SSH session ?


Run tty on your current session, to find out on which tty you are working, so you do not log yourself out from current session


[root@amitmaheshwari.in ~]  # tty
/dev/pts/2


Run w to show you current users and associated pseudo-terminals(tty).

Assuming that you are logged twice and there one other users on your ssh server logged in from pts/1 ,

Your previous ssh session will be on pts/0 and current on pts/2.

To ditch the session on pts/0 simply kill processes that are associated to it with

# pkill -9 -t pts/0