Written by Mark Nash – A DevOpsGuys Intern
Welcome to the start of the Intern Blog at DevOpsGuys! This series of articles will follow the Interns at DevOpsGuys, giving you an insight into what we are doing, what we have learnt and what it’s like to be an Intern at DevOpsGuys.
The Interns of 2015/16 are four students studying computing related degree courses at the University of South Wales in Trefforest (formerly University of Glamorgan).
The Interns are:
All of us signed up for the industrial year because we saw the benefits of getting some experience and skills that so many students are lacking when they leave university.
We have all learnt a lot since coming to DevOpsGuys, and we hope to share some of our learning experiences with you.
SSH Keys and how NOT to consolidate them…
Let’s start with a fun experience we have had in the DevOpsGuys office.
There have been many moments at DevOpsGuys that have made the engineers laugh, most of the time it’s from funny comments, but the time I remember most clearly is when I consolidated my SSH Keys…
We use SSH Keys quite a lot at DevOpsGuys, they are a good way to authenticate with a server, ensuring security, but they are also easy to use. As we started working on different projects we would create SSH Keys to authenticate with the servers for each project, which of course meant that each Intern ended up with about 5 SSH Keys each, and we would not always know which SSH Key was supposed to go with which server.
To ensure we could access servers we would load all the keys into the SSH client, and then forget about them, the client would do the rest of the work, checking if keys matched the servers or not.
Consolidating my SSH Keys was something I had been thinking of doing so I knew which key was for which server, but I had never actually got around to it, until I ended up in a position where it was my only option.
As you can guess, it’s not what I started out trying to accomplish…
One day an engineer and I were discussing how I could get Putty and my SSH Keys to load on start-up of my laptop to save time adding all the different SSH Keys into my Pageant session. During the discussion, the engineer noted I didn’t have comments attached to any of the keys and suggested that might be a good way to identify them.
These are the steps to take to heart…
- Go slowly, pay attention to where you are clicking and be sure it’s the correct place.
- Don’t overwrite important files, create new versions and delete older versions after if you’re sure the new copy is correct.
When I was saving my newly commented keys I didn’t pay attention to which save button I was clicking in Putty, and I was also just saving over the top of my private keys…It’s just a recipe for disaster!! Of course something went wrong, as it always will do… I accidently saved my public key when I was trying to save my newly commented private key, and so I overwrote almost all of my private keys with their public key equivalents…. I’m just glad it was only my SSH Keys I overwrote and not a more important file.
Now it’s a simple fix to push out my new consolidated public key to the servers and now I only have one SSH Key that I can use in multiple places.