I have a few idle ssh sessions that I want to kill. This remote server is used by many users, how do I identify the pids of the sessions that I own?
When I run who
, I get a list of ssh sessions labeled by username.
$ who
me pts/0 2020-11-23 18:05 (tmux(id).%0)
me pts/1 2020-11-06 13:28 (<ip 1>)
someone pts/2 2020-11-09 09:36 (<ip 2>)
someone pts/3 2020-11-26 20:26 (<ip 2>)
...
When I run pstree
, the sessions are no longer labeled by username.
$ pstree -p | grep sshd
|-sshd(930)-+-sshd(3518)---sshd(3536)---python(5736)-+-{python}(5744)
| |-sshd(4285)---sshd(4308)
| |-sshd(5428)---sshd(5450)
...