LM19.3 default behaviour .. SSH: Logout clears entire terminal window?! ☹

Connection sharing, Firewall, Samba..etc
Forum rules
Before you post please read how to get help
Post Reply
User avatar
BG405
Level 8
Level 8
Posts: 2415
Joined: Fri Mar 11, 2016 3:09 pm
Location: England

LM19.3 default behaviour .. SSH: Logout clears entire terminal window?! ☹

Post by BG405 »

This is unexpected and quite frankly not good to implement without a tip=off of some sort. When working on a system remotely, one does not expect acquired data in your Terminal window(s) to be immediately and irrevocably removed without warning upon logout, inckuding eveything you were working on prior to the SSH session.

Fix is as follows (on remote machine). Comment out those pesky lines:

Code: Select all

[brian@*****-MS-7693 ~] $ cat .bash_logout
# ~/.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
[brian@******-MS-7693 ~] $ inxi -S
System:
  Host: *******-MS-7693 Kernel: 5.4.0-42-generic x86_64 bits: 64 Console: tty 0
  Distro: Linux Mint 19.3 Tricia
[brian@*****-MS-7693 ~] $
Just a FYI if you do remote admin on Mint systems. I've obfuscated the hostnames to protect the innocent. ;)
Dell Inspiron 1525 - LM17.3 CE 64-------------------Lenovo T440 8GB - Manjaro KDE with Mint VMs
Toshiba NB250 - Manjaro KDE------------------------K7S5A AMD 1.2GHz - LM17.3 Xfce 32 & WinXP-Pro
Acer Aspire E11 ES1-111M - LM18.2 KDE 64 ----Two ROMS don't make a WRITE ...
User avatar
smurphos
Level 17
Level 17
Posts: 7332
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher
Contact:

Re: LM19.3 default behaviour .. SSH: Logout clears entire terminal window?! ☹

Post by smurphos »

Odd - I don't have that issue - the remote is a minimal ubuntu server, accessing with gnome-terminal. I've copied the terminal content having exited the SSH session...

Code: Select all

steve@steve-Inspiron-5580:~$ ssh 192.168.1.18
Last login: Sun Aug  9 07:36:50 2020 from 192.168.1.26
steve@mint-toshiba:~$ cat .bash_logout
# ~/.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
steve@mint-toshiba:~$ echo $SHLVL
1
steve@mint-toshiba:~$ exit
logout
Connection to 192.168.1.18 closed.
clear_console shouldn't do anything in a regular terminal emulator - it's for TTY's

Code: Select all

steve@steve-Inspiron-5580:~$ clear_console
clear_console: terminal is not a console
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
User avatar
BG405
Level 8
Level 8
Posts: 2415
Joined: Fri Mar 11, 2016 3:09 pm
Location: England

Re: LM19.3 default behaviour .. SSH: Logout clears entire terminal window?! ☹

Post by BG405 »

smurphos wrote:
Sun Aug 09, 2020 2:41 am
clear_console shouldn't do anything in a regular terminal emulator - it's for TTY's
Odd. It cleared mine, so I commented those lines out & it didn't do it from then. I wouldn't think it makes any difference but this was from my Manjaro installation.

As you can imagine, it was a bit of a surprise when the terminal window contents vanished on logout!
Dell Inspiron 1525 - LM17.3 CE 64-------------------Lenovo T440 8GB - Manjaro KDE with Mint VMs
Toshiba NB250 - Manjaro KDE------------------------K7S5A AMD 1.2GHz - LM17.3 Xfce 32 & WinXP-Pro
Acer Aspire E11 ES1-111M - LM18.2 KDE 64 ----Two ROMS don't make a WRITE ...
Post Reply

Return to “Other networking topics”