Hacker News new | past | comments | ask | show | jobs | submit login

When I used to admin Windows servers we had production’s desktop background set to red, that worked well, especially when you had multiple remote desktop sessions open. Wonder if that’s doable for non-GUI enabled Linux servers



The standard way is to set PS1 (the commandline prompt text) to indicate the environment. With escape codes, you can pretty trivially get some flashing red text telling you to be careful.


If used properly the -Confirm parameter in powershell can also have you change the impact level in your environment and ask for confirmation on things that in dev would not be cared about.

Also its underused but the just in time access stuff where you can grant users subsets of permissions (again, per environment) is also pretty impressive.


A not-so standard way is to output a banner via shrc (instead of putting it in the motd, which the ssh daemon will only output for interactive sessions) - which incidentally will also break pretty much all tools using SSH as a transport (scp, rsync, among others).


That was also the case in very old Linux distros when you logged on X as root. I clearly remember something like Fedora or Mandriva doing exactly that - note that graphically logging in as root on a Unix system is not a great idea though, most GUI software isn't designed for it.


Other applications can do it too. I recall the Gnome file browser having a big red warning banner if you decided to launch it with gksudo.


the terminal background could be changed from black to red


SuSE had bright red background with exclamation mark signs and bomb icons


It’s pretty easy to insert colors into to prompt using conditional logic in things like bashrc. You can also add them to other system tools like ‘screen’ and (I assume) ‘tmux’. People can override them if they want, but it’s a good starting default (and people rarely override defaults on a fleet of servers).


My prompt only includes username if it's not the usual one, and it's on an orange-red background if it's root.

Similarly, my prompt doesn't include the host when I'm logged in normally, adds it when I'm in a shell via sudo/doas, and colors it when I'm logged in via SSH.


20 years ago our live/test/dev solaris + linux environments had different coloured prompts (green/yellow/red)

Hasn't really been best practice in many workflows to connect to servers at all for a decade


I use the color of tmux's bar to the same effect.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: