CentOS – Change SSH directory listing colors

The default colors that are displayed when logging into your virtual private server (VPS) are hard to read. In this tutorial we will change the colors displayed when using ssh (putty in our case) to display directory content.

NOTE: This will work for any user, for this example we will reference the user: rolet

  1. cd
    -This will place you in the home directory for the current user
  2. vi .bashrc
  3. Press the “]” key twice
    -This will place your cursor at the bottom of the document
  4. Press “o”
    -This will start a new line after the current position
  5. Copy and paste the following (or type)
    #Start copy
    export LS_OPTIONS=’–color=auto’
    eval `dircolors`
    alias ls=’ls $LS_OPTIONS’
    #End copy

    NOTE: Using putty you can right-click your mouse to paste the clip board.
  6. Press the “Esc” button.
  7. Press and hold “Ctrl” and then “:”
  8. Type “wq”
  9. Do not close the current ssh connection.  We will be opening up a new connection to your VPS.  Encase something when wrong and you are not able to login you will have an open connection.
  10. Establish a new ssh connection to your VPS.
  11. Type “ls” to view the color changes.  If they are the same review the above to make sure everything made it into your .bashrc file.