startKeychain – bash utility to start ssh-agent

For my (and your) future reference, here’s a function to put on your .bashrc or .bash_profile, you can invoke it later at any time to start/re-start your ssh-agent.

function startKeychain {
killall ssh-agent
rm ~/.keychain/*
keychain id_rsa
source ~/.keychain/${HOSTNAME}-sh

Then at any time, the “command” startKeychain will be available on your command line.

Output should look something like this:

gubatron@gubatron-desktop:~$ startKeychain

KeyChain 2.6.8;
Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL

* Initializing /home/gubatron/.keychain/gubatron-desktop-sh file…
* Initializing /home/gubatron/.keychain/gubatron-desktop-csh file…
* Initializing /home/gubatron/.keychain/gubatron-desktop-fish file…
* Starting ssh-agent
* Initializing /home/gubatron/.keychain/gubatron-desktop-sh-gpg file…
* Initializing /home/gubatron/.keychain/gubatron-desktop-csh-gpg file…
* Initializing /home/gubatron/.keychain/gubatron-desktop-fish-gpg file…
* Starting gpg-agent
* Adding 1 ssh key(s)…
Identity added: /home/gubatron/.ssh/id_rsa (/home/gubatron/.ssh/id_rsa)


Comments are welcome to improve it, I’m not an ssh-agent expert, but this seems to do the work.

[SOLVED] Issue with KDE 4.4.2 and Dolphin always asking my ssh passwords whenever I browsed folder I checked out from a remote subversion repository.

Ubuntu/Debian Quick Reference: How To Change Your Server’s UTC Timezone on the command line

Just Type…
sudo dpkg-reconfigure tzdata

…and follow the instructions on screen.

The process should look something like the following:

Select your Region

Select a city on your time zone

You’re done.

You can always check the status of your configuration using
sudo debconf-show tzdata

You could for example map that command via ssh to several machines and grep for “*”, that way you could easily spot servers with wrong timezones very quickly.