2

Possible Duplicate:
How do you make it obvious you are on a production system?

I have several terminal windows open and would like to make the terminal session on the production server look very different from my local machine and staging servers to reduce the chance that I type something on the production server by mistake.

Does anybody have some tips for doing this?

Edit: Just want to clarify - I meant that I have many xterm sessions open and want to disambiguate between them. - Thanks!

readonly
  • 3,209
  • 4
  • 24
  • 23
  • 3
    Please disambiguate what you mean by 'terminal'. Do you mean you have remote desktop connections to Windows boxes open. Or do you have many xterm sessions open with connection to *nix boxes. – Zoredache Dec 04 '09 at 23:44
  • http://serverfault.com/questions/420421/windows-rdp-making-production-server-look-unique/420424#420424 – Ryan Ries Dec 03 '12 at 17:46

7 Answers7

2

If you are talking about remote desktop. I usually change the background or use BG Info so I can at a quick glance know which box I am on.

xeon
  • 3,796
  • 17
  • 18
  • I originally meant a terminal with a command prompt, but thanks for the pointer too the tool. I'm gonna start using that as well. :) – readonly Dec 05 '09 at 04:36
  • cool tip though. I'll remember the BG Info if I ever have Windows servers. – neoice Dec 05 '09 at 05:38
2

change the colors of the prompt. I use this to distinguish between root and users, but you can easily color-code by host. (green for local, yellow for dev, red for production!)

here's a tutorial for bash: http://www.hypexr.org/bash_tutorial.php#colors

YMMV if you use a different shell, but "$SHELL prompt color tutorial" should find it on Google.

neoice
  • 874
  • 4
  • 17
2

Thanks for the suggestions everybody. I ended up taking the following approach:

I used byobu (https://launchpad.net/byobu) to configure GNU screen. I made screen start on login so that there will always be a red bar at the bottom of the terminal like this:

alt text

readonly
  • 3,209
  • 4
  • 24
  • 23
  • This is a good solution, it's effectively a variant on setting `PS1` to something like `PROD:{$HOSTNAME}# ` – voretaq7 Dec 03 '12 at 17:53
0

I'd recommend a combination of :

  • changing the color of the prompt

AND

  • changing the content of the prompt (ex: add [critical] or a similar reminder, just before the end of you prompt)

why?

  • some co-workers could be color blind
  • and when you save or log the session, the text itself would contain the new prompt's content (depending how you log or save the session, you could lose the color information)
Olivier Dulac
  • 1,202
  • 7
  • 14
0

Here's a discussion with several options you can use as a starting point but no Holy Grail one true answer: How do I change the background color of xterm permanently?

fencepost
  • 972
  • 6
  • 10
0

One thing missing is changing your prompt! Using something like this:

root@missioncritical ~:

is subtle but might be enough of a reminder (in addition to the color schemes). As always, exercising caution and using the 'hostname' command are never a bad idea if you are doing something that could potentially break something anywhere.

briealeida
  • 155
  • 4
0

Are you talking about Windows Terminal Server? If so, BgInfo will print unique info about your box right onto dekstop.

Sergey Kovalev
  • 237
  • 1
  • 2
  • 3