remote logoff question

KevinO plug-discuss@lists.plug.phoenix.az.us
Tue, 17 Jun 2003 01:32:51 -0700


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

christian ruckdaschel wrote:
> I have a box at home running RedHat 8 that currently has root logged
> on.  I can logout root locally, but that wouldn't answer my question,
> which is:
>
> If root is logged on locally is there a way to remotely logout root from
> the local session via ssh?
>

Ssh into the remote box as root or su to root.

Use the 'who' command to get the terminal line. (eg. vc/2 or pts/1)

A user on a local virtual console would be a vc/x ....

Now you can do a:

ps auxw | grep vc/2

You will be able to get the PID of the bash shell that is running on that
terminal line. Now just

kill -9 xxxxx

where xxxxx is the PID of that particular bash process.

Type 'who' again to verify that they are now logged out...

This can all be done on one line, of course, but let's not start that again ;-)

- --
KevinO

Hickory Dickory Dock, The mice ran up the clock, The clock struck one, The
others escaped with minor injuries.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE+7tIyjBS1mMJB+bQRAvSSAKC7kT4oOYZBpSt7kasLo/VnVw95EACeI8HL
edxYm5DUwNYu4dVbR20oNS8=
=idSc
-----END PGP SIGNATURE-----