Screen clear on terminal logout (was Re: Orphaned User Accounts?)
On 11/3/2010 9:30 AM, Carlos Mennens wrote: I always wanted to tell them I hate the fact that when 'root' logs out, the terminal / bash window doesn't clear like it does for normal users. I think this should be a Debian default behavior. I can't see a reason beyond over looking it as to why all my commands are still visible as root after I log out. Even normal users have their last login shown. its not root-specific, its a problem with the login getter. -- Morgan Gangwere PGP Key at http://indrora.homelinux.org/gpg_key.asc Why? Because it breaks the logical flow of conversation, plus makes messages unreadable. Top-Posting is evil. signature.asc Description: OpenPGP digital signature
RE: Screen clear on terminal logout (was Re: Orphaned User Accounts?)
Original Message From: Morgan Gangwere [mailto:0.fracta...@gmail.com] Sent: Wednesday, November 03, 2010 8:42 AM To: debian-user@lists.debian.org Subject: Screen clear on terminal logout (was Re: Orphaned User Accounts?) On 11/3/2010 9:30 AM, Carlos Mennens wrote: I always wanted to tell them I hate the fact that when 'root' logs out, the terminal / bash window doesn't clear like it does for normal users. I think this should be a Debian default behavior. I can't see a reason beyond over looking it as to why all my commands are still visible as root after I log out. Even normal users have their last login shown. its not root-specific, its a problem with the login getter. Here's a workaround. This will clear the screen for all users: mv /etc/issue /etc/issue.original clear /etc/issue cat /etc/issue.original /etc/issue James Z -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/4a09477d575c2c4b86497161427dd94c15b0d1f...@city-exchange07
Re: Screen clear on terminal logout (was Re: Orphaned User Accounts?)
James Zuelow wrote: Carlos Mennens wrote: I always wanted to tell them I hate the fact that when 'root' logs out, the terminal / bash window doesn't clear like it does for normal Here's a workaround. This will clear the screen for all users: mv /etc/issue /etc/issue.original clear /etc/issue cat /etc/issue.original /etc/issue Except that clears the screen on login, not logout. It would have effect on a hardware terminal since a logout there is usually followed by the login prompt. But it won't have effect for any network access. Bob signature.asc Description: Digital signature
RE: Screen clear on terminal logout (was Re: Orphaned User Accounts?)
Original Message From: Bob Proulx [mailto:b...@proulx.com] Sent: Wednesday, November 03, 2010 11:35 AM To: debian-user@lists.debian.org Subject: Re: Screen clear on terminal logout (was Re: Orphaned User Accounts?) James Zuelow wrote: Carlos Mennens wrote: I always wanted to tell them I hate the fact that when 'root' logs out, the terminal / bash window doesn't clear like it does for normal Here's a workaround. This will clear the screen for all users: mv /etc/issue /etc/issue.original clear /etc/issue cat /etc/issue.original /etc/issue Except that clears the screen on login, not logout. It would have effect on a hardware terminal since a logout there is usually followed by the login prompt. Sorry, my bad. Since getty respawns as soon as you log out, it effectively clears the screen as soon as you type 'exit', so that is what I use it for. But you're right, it only works for the local display. 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. (Or, I log out and let my /etc/issue trick clear it for me.) I don't see how the remote machine could clear my local display. However there's always a way. You could use a .bash_logout on the remote machine to clear the screen: 1) .bash_logout has one line: /usr/bin/clear 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. 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. There's got to be a zillion ways to do it. James Z -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/4a09477d575c2c4b86497161427dd94c15b0d1f...@city-exchange07
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 signature.asc Description: Digital signature