25

I use putty to ssh to linux box. By default I get black screen background with white foreground. To change colours, I go to change settings -> Window/colours and then I set background colours as white and foreground colours as black. This is more easy on my eyes. But I can't seem to be able to set this colour setting as default and each time I login, I have to set colours. Could someone please suggest a solution?

Thanks,

1
  • question for "superuser"
    – Drakosha
    Dec 6, 2010 at 9:42

7 Answers 7

49

On the "Session" screen, click "Default Settings" and "Load". Then set up your Colors and other useful Options. Go back to the "Session" screen, click "Default Settings" once and then "Save".

All new connection windows will now look as expected.

1
  • 4
    Important note is, that as mentioned it only works for new connections. Existing ones will stay as the were before the change.
    – Christian
    Dec 28, 2015 at 16:52
4

The above instructions will only change colors for the default session. Most PuTTY users have saved sessions for each of the SSH accounts that they use regularly, and none of them are named "Default Settings".

To spare yourself the pain of having to set the colors every time you log in, load any of the saved sessions for which you wish to change the colors (click Load), but do not click Open. Click Window->Colours and set the colors, then click Session again, then click Save. Repeat for each of your saved sessions. Then when you open them, the colors will be what you have set them to be.

4

To reset the colors for an existing session you can save the code below in a .reg file and load it. You have to change 'your_session_name' first.

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\your_session_name]
"Colour0"="187,187,187"
"Colour1"="255,255,255"
"Colour2"="0,0,0"
"Colour3"="85,85,85"
"Colour4"="0,0,0"
"Colour5"="0,255,0"
"Colour6"="0,0,0"
"Colour7"="85,85,85"
"Colour8"="187,0,0"
"Colour9"="255,85,85"
"Colour10"="0,187,0"
"Colour11"="85,255,85"
"Colour12"="187,187,0"
"Colour13"="255,255,85"
"Colour14"="0,0,187"
"Colour15"="85,85,255"
"Colour16"="187,0,187"
"Colour17"="255,85,255"
"Colour18"="0,187,187"
"Colour19"="85,255,255"
"Colour20"="187,187,187"
"Colour21"="255,255,255"
1

Alternately, if you don't want to set the colors in Putty itself, you can set them in your Linux shell (if you add commands to your .login they will run anytime you log in):

tput setab 5     <== sets background color
tput setaf 2     <== sets font color
clear            <== clears the screen so the changes apply to entire window

Putty will respect these changes

1
  • This will work ... until the system does something to change the values again. For example, my RH6 will do a colored ls and set the colors back to their original default values when it's finished.
    – hymie
    Apr 3, 2019 at 13:59
0
  • Open PuTTY
  • Under Saved Sessions, click on a saved session
  • Click Load
  • Click on Window->Colours
  • Under General options for colour usage, click the top two check boxes: Allow terminal...
  • Go back to Session
  • Click Save
  • Click Open

Now when I log into my Raspberry Pi, the command line and directories are shown in color.

0

To edit colors for existing sessions: PUTTY stores session data in the windows registry.

I changed the default session colors (R, G, B) after I had many sessions created.

  • blue to 15, 154, 229
  • red 244, 67,54

In your registry

HKEY_LOCAL_USERS\S-1-5-<biggest no.>\Software\SimonTatham\Sessions

open the Default%20Settings folder. The key Color14 contains the value for blue, the key Color8 contains the value for red.

Simply double-click Color8 and copy the value and paste it to all other Sessions/folders in that "Sessions" folder, same with Color14.

You also could export the entire "Sessions" folder to a .reg file, edit it with and import it again.

0

For anyone looking for a way to go back to default PuTTY colours you need to remove the following registry key:

Computer\HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\Default Settings

You must log in to answer this question.

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