Mailinglist Archive: opensuse (3232 mails)

< Previous Next >
Re: [SLE] close login of user
  • From: Leendert Meyer <leen.meyer@xxxxxxx>
  • Date: Mon, 21 Aug 2006 19:31:57 +0000 (UTC)
  • Message-id: <200608212132.48753.leen.meyer@xxxxxxx>
On Monday 21 August 2006 20:30, Jerry Feldman wrote:
> On Monday 21 August 2006 2:07 pm, Leendert Meyer wrote:
> > On Tuesday 08 August 2006 20:27, James D. Parra wrote:
> > > Hello,
> > >
> > > Short of rebooting, how to close an open session of a user who is
> > > logged in?
> >
> > Would that be you, logged in more that once (perhaps using one or more
> > different logins), or would that be another person?
> >
> > If it's you, wel, you know best... ;)
> >
> > If it's another person, perhaps "man shutdown" could be of use: it allows
> > you to send a warning to all users who are logged in over a text console,
> > together with specifying a delay (e.g. "Warning: the system will shut
> > down in 5 minutes. Save your work and logout immediately."). I suppose
> > you could come up with nicer messages... ;)
>
> The OP stated "short of rebooting".

Yes, he did. Your point? :)

> You can easily use the wall(1) command to broadcast a message to all those
> who are logged in. Or, you can use the write(1) command to send a message
> to a specific user.

Indeed.

> Then, a simple kill(1) directed at the controlling terminal will cause any
> specific user to be logged out. You could write a simple shell or perl
> script to look at who is logged in (who), parse it to get the terminal (eg.
> pts/1 tty1, ttyS1, ...) then do a ps ax and simply kill all processes
> associated.

Why is that better? If I am logged in twice (ssh) on a remote pc, and I issue
a "shutdown -h now; exit" on one terminal, then the other terminal gets a
warning message, and that connection is closed. So why all the extra work?
(I've switched myself into learning mode... ;)

Cheers,

Leen

< Previous Next >
Follow Ups