Re: clear old output in login screen?

2009-05-05 Thread perryh
Mike Clarke jmc-freeb...@milibyte.co.uk wrote:
 On Monday 04 May 2009, per...@pluto.rain.com wrote:
...
  ? #!/bin/csh
  ? clear
  ? vidcontrol -C
  ? exec /usr/bin/login.real $@

 But this wouldn't prevent someone scrolling back with the scroll
 lock key before logging in. I assume the OP's requirement is to
 stop people from seeing previous users console activity.

That's what the vidcontrol -C line is supposed to accomplish,
based on my reading of vidcontrol(1) and earlier messages in the
thread.  Granted I have not actually tried it.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: clear old output in login screen?

2009-05-05 Thread Mike Clarke
On Tuesday 05 May 2009, per...@pluto.rain.com wrote:

 Mike Clarke jmc-freeb...@milibyte.co.uk wrote:
  On Monday 04 May 2009, per...@pluto.rain.com wrote:

 ...

   ? #!/bin/csh
   ? clear
   ? vidcontrol -C
   ? exec /usr/bin/login.real $@
 
  But this wouldn't prevent someone scrolling back with the scroll
  lock key before logging in. I assume the OP's requirement is to
  stop people from seeing previous users console activity.

 That's what the vidcontrol -C line is supposed to accomplish,
 based on my reading of vidcontrol(1) and earlier messages in the
 thread.  Granted I have not actually tried it.

Yes, vidcontrol -C will accomplish this, but my point was that 
including this as part of the replacement login script is too late. You 
don't need to be logged in to use the scroll lock and pg{Up,Dn} keys. 
To prevent people seeing the previous users activity you would need to 
clear the console buffer at the logout stage.

-- 
Mike Clarke
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: clear old output in login screen?

2009-05-05 Thread Frank Shute
On Tue, May 05, 2009 at 09:45:16AM +0100, Mike Clarke wrote:

 On Tuesday 05 May 2009, per...@pluto.rain.com wrote:
 
  Mike Clarke jmc-freeb...@milibyte.co.uk wrote:
   On Monday 04 May 2009, per...@pluto.rain.com wrote:
 
  ...
 
? #!/bin/csh
? clear
? vidcontrol -C
? exec /usr/bin/login.real $@
  
   But this wouldn't prevent someone scrolling back with the scroll
   lock key before logging in. I assume the OP's requirement is to
   stop people from seeing previous users console activity.
 
  That's what the vidcontrol -C line is supposed to accomplish,
  based on my reading of vidcontrol(1) and earlier messages in the
  thread.  Granted I have not actually tried it.
 
 Yes, vidcontrol -C will accomplish this, but my point was that 
 including this as part of the replacement login script is too late. You 
 don't need to be logged in to use the scroll lock and pg{Up,Dn} keys. 
 To prevent people seeing the previous users activity you would need to 
 clear the console buffer at the logout stage.
 

I see what you mean.

Perhaps put vidcontrol -C in /etc/csh.logout

For other shells e.g ksh:

alias logout='~/.ksh_logout; exit'

(not tested)

It seems that for sh, logout is a builtin but it's not mentioned in
it's manpage.


Regards,

-- 

 Frank 


 Contact info: http://www.shute.org.uk/misc/contact.html 

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: clear old output in login screen?

2009-05-04 Thread Mike Clarke
On Monday 04 May 2009, per...@pluto.rain.com wrote:

 If I needed to do this, could not find a way to do it via
 configuration settings, and didn't want to hack the login
 source code, I would try renaming the login binary to
 something like login.real, and replacing it with an
 executable script containing something like:

   #!/bin/csh
   clear
   vidcontrol -C
   exec /usr/bin/login.real $@

But this wouldn't prevent someone scrolling back with the scroll lock 
key before logging in. I assume the OP's requirement is to stop people 
from seeing previous users console activity.

-- 
Mike Clarke
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


clear old output in login screen?

2009-05-03 Thread jw
Currently, if I log in, do some work, then log out (from plain TTY, no
X/SSH/etc), the output of my previous session is still readable above
the new login:  prompt. One can use scroll lock to view even more.

How do I get it to clear the screen (and the scroll buffer) when the
login prompt gets redisplayed?

-John
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: clear old output in login screen?

2009-05-03 Thread gabe g
Hey John,
  In order to achieve this, there are two methods that I know of,
however, they are only tested in the Bourne and Bourne Again shells.

clear  logout # Bourne Again (Bash) Shell
clear  exit # Bourne (sh) Shell

You may have to try similar commands (specific for that shell) for shells
that are not Bourne-derived, but one of these two commands should almost
always work.

Sincerely,
Gabriel
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: clear old output in login screen?

2009-05-03 Thread Emiel van de Laar

On May 3, 2009, at 9:48 PM, gabe g wrote:


Hey John,
 In order to achieve this, there are two methods that I know of,
however, they are only tested in the Bourne and Bourne Again shells.

clear  logout # Bourne Again (Bash) Shell
clear  exit # Bourne (sh) Shell

You may have to try similar commands (specific for that shell) for  
shells
that are not Bourne-derived, but one of these two commands should  
almost

always work.


Hello,

zsh has .zlogout which gets read/executed when the shell exits. I  
have the

following setup:

~ % cat ~/.zlogout
clear

Perhaps other shells have a similar feature.

Regards,

 - Emiel

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: clear old output in login screen?

2009-05-03 Thread Peter Boosten


On 3 mei 2009, at 21:48, gabe g wrote:


Hey John,
 In order to achieve this, there are two methods that I know of,
however, they are only tested in the Bourne and Bourne Again shells.

clear  logout # Bourne Again (Bash) Shell
clear  exit # Bourne (sh) Shell

You may have to try similar commands (specific for that shell) for  
shells
that are not Bourne-derived, but one of these two commands should  
almost

always work.



clear  /etc/issue

Peter
--
http://www.boosten.org
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: clear old output in login screen?

2009-05-03 Thread Jonathan Chen
On Sun, May 03, 2009 at 11:46:30AM -0700, jw wrote:
 Currently, if I log in, do some work, then log out (from plain TTY, no
 X/SSH/etc), the output of my previous session is still readable above
 the new login:  prompt. One can use scroll lock to view even more.
 
 How do I get it to clear the screen (and the scroll buffer) when the
 login prompt gets redisplayed?

If you're using tcsh, you can put the following into ~/.logout:

clear

-- 
Jonathan Chen j...@chen.org.nz

We laugh in the face of danger, we drop icecubes down the vest of fear
 - Edmond Blackadder III
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: clear old output in login screen?

2009-05-03 Thread Paul B. Mahol
On 5/3/09, jw jwde...@gmail.com wrote:
 Currently, if I log in, do some work, then log out (from plain TTY, no
 X/SSH/etc), the output of my previous session is still readable above
 the new login:  prompt. One can use scroll lock to view even more.

 How do I get it to clear the screen (and the scroll buffer) when the
 login prompt gets redisplayed?

My /etc/csh.logout and /etc/csh.login contains:

echo $TERM | grep cons25  /dev/null  clear  vidcontrol -C

For other shells it's similar.
-- 
Paul
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: clear old output in login screen?

2009-05-03 Thread jw
On Sun, May 3, 2009 at 12:48 PM, gabe g johndoeismyn...@gmail.com wrote:
 Hey John,
   In order to achieve this, there are two methods that I know of,
 however, they are only tested in the Bourne and Bourne Again shells.

 clear  logout # Bourne Again (Bash) Shell
 clear  exit # Bourne (sh) Shell


I tried this, but I can still scroll back with the scroll lock key.
'clear' seems to just put the prompt at the top of the screen, not get
rid of scroll history...

-John
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: clear old output in login screen?

2009-05-03 Thread jw
On Sun, May 3, 2009 at 1:51 PM, Paul B. Mahol one...@gmail.com wrote:

 echo $TERM | grep cons25  /dev/null  clear  vidcontrol -C


Aha! I didn't know about 'vidcontrol -C'
That combined with 'clear' does the trick.

However...
Is there any way I could have this execute when the login: prompt
displays, rather than having each user need to do it themselves?

In other words, I want this clearing to happen for all users
regardless of shell, etc.

I haven't seen anything in login(1) or login.conf(5) that allows this
kind of customization, but maybe I missed it...

-John
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: clear old output in login screen?

2009-05-03 Thread Polytropon
On Sun, 3 May 2009 11:46:30 -0700, jw jwde...@gmail.com wrote:
 How do I get it to clear the screen (and the scroll buffer) when the
 login prompt gets redisplayed?

Two options:

a) Clear everything right after login. Put the command clear
   in your ~/.login, or /etc/csh.login for all users.

b) Clear everything right after logout, so the new login will
   get a blank screen. Put the command clear in your ~/.logout,
   or /etc/csh.logout for all users.

This assumes that you have the standard dialog shell csh. If
you're using bash, you need to modify its respective files,
~/.profile or ~/.bashrc - I don't know, I'm using csh. :-)



-- 
Polytropon
From Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: clear old output in login screen?

2009-05-03 Thread perryh
jw jwde...@gmail.com wrote:
 On Sun, May 3, 2009 at 1:51 PM, Paul B. Mahol one...@gmail.com wrote:
  echo $TERM | grep cons25  /dev/null  clear  vidcontrol -C

 Aha! I didn't know about 'vidcontrol -C'
 That combined with 'clear' does the trick.

 However...
 Is there any way I could have this execute when the login:
 prompt displays, rather than having each user need to do it
 themselves?

 In other words, I want this clearing to happen for all users
 regardless of shell, etc.

If I needed to do this, could not find a way to do it via
configuration settings, and didn't want to hack the login
source code, I would try renaming the login binary to
something like login.real, and replacing it with an
executable script containing something like:

  #!/bin/csh
  clear
  vidcontrol -C
  exec /usr/bin/login.real $@

Granted such a hack will need to be redone any time you do
an installworld.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: clear old output in login screen?

2009-05-03 Thread Matt Emmerton

0 jw jwde...@gmail.com wrote:

On Sun, May 3, 2009 at 1:51 PM, Paul B. Mahol one...@gmail.com wrote:
 echo $TERM | grep cons25  /dev/null  clear  vidcontrol -C

Aha! I didn't know about 'vidcontrol -C'
That combined with 'clear' does the trick.

However...
Is there any way I could have this execute when the login:
prompt displays, rather than having each user need to do it
themselves?

In other words, I want this clearing to happen for all users
regardless of shell, etc.


If I needed to do this, could not find a way to do it via
configuration settings, and didn't want to hack the login
source code, I would try renaming the login binary to
something like login.real, and replacing it with an
executable script containing something like:

 #!/bin/csh
 clear
 vidcontrol -C
 exec /usr/bin/login.real $@

Granted such a hack will need to be redone any time you do
an installworld.


The solution I've deployed in my environment is to have /etc/issue contain a 
single ^L character.
Prior to doing that, /etc/issue contained 25+ blank lines, which effectively 
cleared the terminal before displaying the login prompt.


Regards,
--
Matt Emmerton 


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org