Got nothing from "ps aux|fgrep acheng@ttyp4". No SSHD process to kill either.
The problem for me is that no process belongs to ttyp4, but "w" still reports an idle session. FYI: $ ps aux|fgrep acheng@ttyp4 $ w 9:57PM up 13 days, 1:31, 3 users, load averages: 0.16, 0.18, 0.23 USER TTY FROM LOGIN@ IDLE WHAT acheng p0 180.116.63.38 6:00PM 1:50 -ksh acheng p1 114.227.120.20 8:06PM 0 w acheng p4 114.227.123.110 27Jul12 9days - $ ps aux | grep ksh acheng 13452 0.0 0.1 548 500 p0 Is 6:00PM 0:00.02 -ksh (ksh) root 25705 0.0 0.1 632 528 p0 I+ 6:07PM 0:00.07 -ksh (ksh) acheng 30721 0.0 0.1 480 488 p1 Ss 8:06PM 0:00.02 -ksh (ksh) acheng 28924 0.0 0.0 480 4 p1 R+ 9:57PM 0:00.00 -ksh (ksh) $ ps aux | grep sshd root 16212 0.0 0.2 656 1208 ?? Is 23Jul12 0:04.01 /usr/sbin/sshd root 30292 0.0 0.5 3456 2812 ?? Is 6:00PM 0:00.07 sshd: acheng [priv] (sshd) acheng 9594 0.0 0.7 4724 3612 ?? I 6:00PM 0:02.20 sshd: acheng@ttyp0 (sshd) root 22538 0.0 0.5 3428 2828 ?? Is 8:06PM 0:00.06 sshd: acheng [priv] (sshd) acheng 18141 0.0 0.6 3880 2920 ?? S 8:06PM 0:02.19 sshd: acheng@ttyp1 (sshd) Thanks for the response. acheng On Mon, Aug 6, 2012 at 11:42 AM, David Diggles <da...@elven.com.au> wrote: > On Mon, Aug 06, 2012 at 01:38:27PM +1000, David Diggles wrote: > > Try this? > > > > ps aux|fgrep acheng@ttyp3 > > > ps aux|fgrep acheng@ttyp4 > > do you get the sshd process id you can kill? > > > > On Mon, Aug 06, 2012 at 10:56:00AM +0800, Alan Cheng wrote: > > > Hello all, > > > > > > I'd like to kill an stale user session, but could not find a way to do > > > that. Seems like there is no process attached to that ttyp4 any more. > It's > > > an OpenBSD 5.1 on i386, by the way. > > > > > > Any advice appreciated. > > > > > > some output, more will be provided if necessary. > > > > > > #w > > > 7:44PM up 12 days, 23:19, 2 users, load averages: 0.10, 0.14, 0.18 > > > USER TTY FROM LOGIN@ IDLE WHAT > > > acheng p0 180.116.63.38 6:00PM 0 w > > > acheng p4 114.227.123.110 27Jul12 9days - > > > <-- the one I'd like to kill > > > > > > > ------------------------------------------------------------------------------------------------------------ > > > #ps -t p4 > > > PID TT STAT TIME COMMAND > > > > > > > > > thanks. > > > acheng