[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Screen clear on terminal logout (was Re: Orphaned User Accounts?)



James Zuelow wrote:
> >But it won't have effect for any network access.
> 
> The only network access I typically do is ssh, and when I'm done I
> just close the konsole window.  If I am working from a console I
> could just type `clear` when I'm done if I want to clear the screen.

Exactly my point!  The user can always clear the display as
appropriate to clear any sensitive data still shown there.

> However there's always a way.  You could use a .bash_logout on the
> remote machine to clear the screen:
> ...

Ahem...  The previous discussion was concerning Debian's default for
just such a /etc/skel/.bash_logout script.  I personally don't like
that and so remove it.  But the original poster *did* like it and was
asking for having it expanded to cover /root/.bash_logout too.
Currently the /root account is set up by the debian-installer and
doesn't install the /etc/skel/* files like adduser does when adding
additional users.  As such the root account is special simply because
it is the very first account installed on the system and is set up by
the debian-installer before the rest of the system is available.

> 1) .bash_logout has one line:
>     /usr/bin/clear

You have *almost* duplicated the default Debian .bash_logout except
that the Debian version handles different terminal types too.

> Or if for some reason you can't do that, you can do it locally with
> an alias in .bashrc:
> 
> 1) make a small bash script, /usr/local/bin/autoclear_ssh.sh:
>      #!/bin/bash
>      ssh $@ && clear
> 2) make an alias in your .bashrc:
>      alias ssh='/usr/local/bin/autoclear_ssh.sh'
> 3) Profit!!!
> Then when you ssh to a server, the display will clear when you're done.

Or you could use Control-L after logging out when you want to clear
the screen.  A lot less work. :-)

> It's not perfect though, because if you send ssh a command that
> terminates right away like `ssh 192.168.1.1 ls` the script will
> clear the screen before you see your ls output.  The .bash_logout is
> probably better.

Losing information that I need from the screen is the annoyance.

> There's got to be a zillion ways to do it.

Or not do it.  :-)

Cheers,
Bob

Attachment: signature.asc
Description: Digital signature


Reply to: