Managing Unix with Unix

It seems that many companies that run Unix/Linux servers don't let their admins run Unix or Linux. I'm not going to speculate about the preferences about other admins out there, but for myself, Windows XP, or even Windows 7 is nothing in comparison to desktop Linux. For me, the two most frustrating things I miss about desktop Linux while at work is transparent windows and a real Linux terminal (sorry PuTTY and KiTTY I just have to many issues while using you). The transparent windows I miss mostly because I write scripts just about all day while continuing to monitor our environment. It'd just be nicer having a full screen terminal that was semi-transparent so I could see our dashboards without having to change windows. Sure hot keys are good, but transparency is better.

Anyways, I recently decided to try an experiment. I had a spare desktop laying around at work, so I installed Linux. My team uses private keys to log in to everything (trust me on this there is a lot of everything). We have several private keys that we use to get in to different boxes. One upside to PuTTY and KiTTY is that they come with Pagent. Pagent basically keeps your private keys loaded in and tries to use them with each new ssh session.This is super nice, but how do we do this in Linux?

The answer: ssh-agent.

Like Pagent, the ssh-agent is a daemon that runs in the background and keeps the keys you have added in memory. I ran into one small issue with using it though. An ssh-agent instance is tied to a bash session. If for instance, you try to run ssh-add on a bash session without an ssh-agent running in it, you will receive the error Could not open a connection to your authentication agent.

The way to fix this is to put the following line in your .bash_profile: eval $(ssh-agent)

If you really want to get crazy, you can even put ssh-add into your .bash_profile. The major downside to this though is that every new bash instance will ask for your private passwords if you have any set.