Clearing the console each time a user logs out

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Clearing the console each time a user logs out

Olivier Regnier-7
Hello,

I installed OpenBSD 4.5 on my Samsung NC10. I want to clear the console each
time a user logs out. I modified /etc/gettytab file but i have no result. Can
you give me some information on this topic ?

Thank you in advance.

_________________________________________________________________
Inidit ! Des Emotictnes Dijanties! Installez les dans votre Messenger !
http://www.ilovemessenger.fr/Emoticones/EmoticonesDejantees.aspx

Reply | Threaded
Open this post in threaded view
|

Re: Clearing the console each time a user logs out

Jan-Erik Skata
On Thu, Jul 9, 2009 at 9:59 PM, Olivier Regnier <[hidden email]>wrote:

> Hello,
>
> I installed OpenBSD 4.5 on my Samsung NC10. I want to clear the console
> each
> time a user logs out. I modified /etc/gettytab file but i have no result.
> Can
> you give me some information on this topic ?
>
> Thank you in advance.
>
> _________________________________________________________________
> Inidit ! Des Emotictnes Dijanties! Installez les dans votre Messenger !
> http://www.ilovemessenger.fr/Emoticones/EmoticonesDejantees.aspx
>
>
Depeding on your shell, you could do this from a .logout file (and from
/etc/skel to be added to all new users). This .bash_logout is used by
KUbuntu:

# ~/.bash_logout: executed by bash(1) when login shell exits.

# when leaving the console clear the screen to increase privacy

if [ "$SHLVL" = 1 ]; then
    [ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q
fi

Reply | Threaded
Open this post in threaded view
|

Re: Clearing the console each time a user logs out

Stuart Henderson
In reply to this post by Olivier Regnier-7
On 2009-07-09, Olivier Regnier <[hidden email]> wrote:
> Hello,
>
> I installed OpenBSD 4.5 on my Samsung NC10. I want to clear the console each
> time a user logs out. I modified /etc/gettytab file but i have no result. Can
> you give me some information on this topic ?
>
> Thank you in advance.

you need to modify std.9600 or default in gettytab, unless you change the
terminal type in ttys.

I'm not sure if there's a good way to clear the scrollback buffer though.

Reply | Threaded
Open this post in threaded view
|

Re: Clearing the console each time a user logs out

Jason McIntyre-2
On Thu, Jul 09, 2009 at 11:05:05PM +0000, Stuart Henderson wrote:

> On 2009-07-09, Olivier Regnier <[hidden email]> wrote:
> > Hello,
> >
> > I installed OpenBSD 4.5 on my Samsung NC10. I want to clear the console each
> > time a user logs out. I modified /etc/gettytab file but i have no result. Can
> > you give me some information on this topic ?
> >
> > Thank you in advance.
>
> you need to modify std.9600 or default in gettytab, unless you change the
> terminal type in ttys.
>
> I'm not sure if there's a good way to clear the scrollback buffer though.

if you just want a clear screen for the next login, you can have
your shell catch the EXIT signal and clear the screen. for example,
in a ksh .profile, have:

        trap clear EXIT

or instead of running clear, it could source a file of commands, or
whatever. the "trap" built-in is described in more detail in ksh(1). i
don;t know if csh has an equivalent.

that doesn;t clear the scrollback buffer exactly, but it will clear most
of it.

jmc

Reply | Threaded
Open this post in threaded view
|

Re: Clearing the console each time a user logs out

Olivier Regnier-7
In reply to this post by Stuart Henderson
I have already modified the file "gettytab" with these lines:

P:Pc:Pc   console:\
:np:sp#9600:\
:cl=\E[H\E[2J:

This does not work ? An idea ?

> To: [hidden email]
> From: [hidden email]
> Subject: Re: Clearing the console each time a user logs out
> Date: Thu, 9 Jul 2009 23:05:05 +0000
>
> On 2009-07-09, Olivier Regnier <[hidden email]> wrote:
> > Hello,
> >
> > I installed OpenBSD 4.5 on my Samsung NC10. I want to clear the console
each
> > time a user logs out. I modified /etc/gettytab file but i have no result.
Can
> > you give me some information on this topic ?
> >
> > Thank you in advance.
>
> you need to modify std.9600 or default in gettytab, unless you change the
> terminal type in ttys.
>
> I'm not sure if there's a good way to clear the scrollback buffer though.
>

_________________________________________________________________
Vous voulez savoir ce que vous pouvez faire avec le nouveau Windows Live ?
Lancez-vous !
http://www.microsoft.com/windows/windowslive/default.aspx

Reply | Threaded
Open this post in threaded view
|

Re: Clearing the console each time a user logs out

Mark Zimmerman
On Fri, Jul 10, 2009 at 08:48:12PM +0200, Olivier Regnier wrote:
> I have already modified the file "gettytab" with these lines:
>
> P:Pc:Pc   console:\
> :np:sp#9600:\
> :cl=\E[H\E[2J:
>
> This does not work ? An idea ?
>

The FAQ entry for this has been wrong for a few releases now. Try
this:

2|std.9600|9600-baud:\
        :sp#9600:\
        :cl=\E[H\E[2J:

Assuming /etc/ttys has this for the console:

console "/usr/libexec/getty std.9600"   vt220   off secure

Reply | Threaded
Open this post in threaded view
|

Re: Clearing the console each time a user logs out

Stuart Henderson
In reply to this post by Olivier Regnier-7
On 2009/07/10 20:48, Olivier Regnier wrote:
>
> I have already modified the file "gettytab" with these lines:
>
> P:Pc:Pc   console:\
> :np:sp#9600:\
> :cl=\E[H\E[2J:
>
> This does not work ? An idea ?

Please read my mail again, you missed something in it.


> > To: [hidden email]
> > From: [hidden email]
> > Subject: Re: Clearing the console each time a user logs out
> > Date: Thu, 9 Jul 2009 23:05:05 +0000
> >
> > On 2009-07-09, Olivier Regnier <[hidden email]> wrote:
> > > Hello,
> > >
> > > I installed OpenBSD 4.5 on my Samsung NC10. I want to clear the console each
> > > time a user logs out. I modified /etc/gettytab file but i have no result. Can
> > > you give me some information on this topic ?
> > >
> > > Thank you in advance.
> >
> > you need to modify std.9600 or default in gettytab, unless you change the
> > terminal type in ttys.
> >
> > I'm not sure if there's a good way to clear the scrollback buffer though.
> >
>
> _________________________________________________________________
> Vous voulez savoir ce que vous pouvez faire avec le nouveau Windows Live ? Lancez-vous !
> http://www.microsoft.com/windows/windowslive/default.aspx

Reply | Threaded
Open this post in threaded view
|

Re: Clearing the console each time a user logs out

Olivier Regnier-7
In reply to this post by Mark Zimmerman
_________________________________________________________________
Tiliphonez gratuitement ` tous vos proches avec Windows Live Messenger  !
Tilichargez-le maintenant !
http://www.windowslive.fr/messenger/1.asp