Self-describing infrastructure

Sometimes i take on to setup infrastructure for projects i’m on to test things out in a safe space. And if i’m to call myself a proper DevOps professional i must know how to handle the systems i advocate. However, i have a awful memory, and i often forget what systems i host where. So i have gotten into a habit of letting my servers both tell me who they are.

Name your servers and display as banners

Every half-decent server-administrator names their servers after a pattern. I use  the NATO Phonetic Alphabet since my first laptop i paid for myself. I’m down to Lima today. Everything gets more personal once you name it. It helps a little, but having names tells me nothing of what i’m running on them or what sites they power. I usually keep the names of the server in the SSH banner. You can configure it by editing the sshd_config:

sudo vi /etc/ssh/sshd_config

Also add or uncomment:

Banner /etc/banner

Then i and put the name in it. As soon as i enter a username then i’m shown the name of the server.

login as: poweruser
|  _                             |
| | |                            |
| | |__  _ __ __ ___   __ __     |
| | '_ \| '__/ _` \ \ / / _ \    |
| | |_) | | | (_| |\ V / (_) )   |
| |_.__/|_|  \__,_| \_/ \___/    |
|                                |

Make sure you restart the ssh service for the changes to take effect.

sudo /etc/init.d/ssh restart

Using Message Of The Day to describe services

I also add a MOTD to describe the server as soon as i’m logged on, this is not exposed before being logging in to machine so i don’t expose anything unneccessary about my system.

sudo vi /etc/motd's password:
| Logged on to BRAVO 
| Serving domains: 
| - 
| - 
| - 
| Reverse-proxy for: 
| - 
| - 
| - 

The tricky part is to remember to modify them as soon as i add services. 🙂

No Comments

You can leave the first : )

Leave a Reply

Your email address will not be published. Required fields are marked *