How can I logout an open, remote SSH session?
-------------------------------------------------------------------------------
Become or hire the top 3% of the developers on Toptal https://topt.al/25cXVn
-------------------------------------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Lost Meadow
--
Chapters
00:00 Question
00:59 Accepted answer (Score 83)
01:40 Answer 2 (Score 4)
01:59 Thank you
--
Full question
https://superuser.com/questions/193168/h...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#linux #ssh
#avk47
Become or hire the top 3% of the developers on Toptal https://topt.al/25cXVn
-------------------------------------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Lost Meadow
--
Chapters
00:00 Question
00:59 Accepted answer (Score 83)
01:40 Answer 2 (Score 4)
01:59 Thank you
--
Full question
https://superuser.com/questions/193168/h...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#linux #ssh
#avk47
ACCEPTED ANSWER
Score 83
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. Run w
to show you current users and associated pseudo-terminals(tty). Assuming that you are logged twice and there are no other users on your ssh server, your previous ssh session will be on pts/0
and current on pts/1
. To ditch the session on pts/0
simply kill processes that are associated to it with
pkill -9 -t pts/0
ANSWER 2
Score 5
Assuming you don't have any other processes you don't want to be 86'ed, you can just do:
$ ssh <systemname> pkill -u <yourlogin>
And the other session will go away.