Discussion:
Clearing the console each time a user logs out
Olivier Regnier
2009-07-09 18:59:53 UTC
Permalink
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
Jan-Erik Skata
2009-07-09 20:54:26 UTC
Permalink
Post by Olivier Regnier
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
Stuart Henderson
2009-07-09 23:05:05 UTC
Permalink
Post by Olivier Regnier
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.
Jason McIntyre
2009-07-10 06:40:37 UTC
Permalink
Post by Stuart Henderson
Post by Olivier Regnier
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
Olivier Regnier
2009-07-10 18:48:12 UTC
Permalink
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 ?
Subject: Re: Clearing the console each time a user logs out
Date: Thu, 9 Jul 2009 23:05:05 +0000
Post by Olivier Regnier
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
Stuart Henderson
2009-07-10 20:01:39 UTC
Permalink
Post by Olivier Regnier
P:Pc:Pc console:\
:np:sp#9600:\
This does not work ? An idea ?
Please read my mail again, you missed something in it.
Post by Olivier Regnier
Subject: Re: Clearing the console each time a user logs out
Date: Thu, 9 Jul 2009 23:05:05 +0000
Post by Olivier Regnier
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
Olivier Regnier
2009-07-10 20:54:46 UTC
Permalink
_________________________________________________________________
Tiliphonez gratuitement ` tous vos proches avec Windows Live Messenger !
Tilichargez-le maintenant !
http://www.windowslive.fr/messenger/1.asp
Mark Zimmerman
2009-07-10 19:33:04 UTC
Permalink
Post by Olivier Regnier
P:Pc:Pc console:\
:np:sp#9600:\
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

Continue reading on narkive:
Loading...