I wonder if i can disconnect a specific ssh client from ssh server?
Can we do that?
Thanks in advance...
31 Answer
This is answered here:
A copy of the steps:
There's probably an easier way, but I do this:
See who's logged into your machine -- use
whoorw:> who mmrozek tty1 Aug 17 10:03 mmrozek pts/3 Aug 17 10:09 (:pts/2:S.0)Look up the process ID of the shell their TTY is connected to:
> ps t PID TTY STAT TIME COMMAND 30737 pts/3 Ss 0:00 zshLaugh at their impending disconnection (this step is optional, but encouraged)
> echo "HAHAHAHAHAHAHAHA" | write mmrozek pts/3Kill the corresponding process:
> kill -9 30737
I just discovered you can combine steps 1 and 2 by giving who the -u flag; the PID is the number off to the right:
> who -u
mmrozek tty1 Aug 17 10:03 09:01 9250
mmrozek pts/18 Aug 17 10:09 01:46 19467 (:pts/2:S.0)