0

I use putty and ssh to connect to my Linux servers. I have a Linux Mint 19.3 server running with encrypted home directory. When I connect using putty and ssh, I decrypt the home directory. But the putty terminal is not showing any colors to provide a better readability of the terminal commands and responses. If I use a second putty terminal and connect open a second ssh connection to the same server. I do not need to decrypt home directory again but in this console the colors are correctly displayed in the putty console.

When connecting to e.g. a raspbian server (without encrypted home directory) putty is always displaying the colors.

What do I need to adjust on the Linux Mint server so that the colors are used in the putty terminal?

4
  • 1
    Do the colors come back if you source your shell initialization files after connecting (ex. . ~/.profile and/or . ~/.bashrc)? May 2, 2020 at 15:42
  • @steeldriver: Could you please explain your hint a little bit more? I fear I can not really follow you.
    – wewa
    May 3, 2020 at 9:22
  • It was a genuine question rather than a hint - my guess is that the SSH login shell tries to read your initialization files but fails because they are inside the encrypted home dir, and that maybe reading them after decryption (with a source command) would restore the color terminal settings May 3, 2020 at 12:36
  • If I use the command . ~/.profile after decrypting the home folder, the colors are back.
    – wewa
    May 3, 2020 at 15:41

1 Answer 1

1

The ~/.profile script needs to be executed after login in with ssh and putty. Therefore edit the ~/.profile script in the home folder before decrypting it.

$ sudo nano ~/.profile

And enter following content.

ecryptfs-mount-private
cd /home/username
. /home/username/.profile

The above content contains also the commands for decrypting your home folder and changing your working directory to your decrypted home folder. And remember, you need to to ediit ~/.profile before decrypting your home directory.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .