K, so I’ve reached the point that updating all the applications across my ever growing little network has become a seriously tedious process. Some one in some forum somewhere mentioned using ssh-keygen to eliminate the need for the continuous password process when using ssh. Here’s how I handled that (took me long enough, I’ve been using ssh (PuTTy in MS) for ever).
First you’ll need to generate your ssh key. It looks like this all together (I’ll splice in the items I included). Make sure you are in your ~ directory. Might even be easier if you move to your users .ssh directory (like this: $ cd ~/.ssh). That way you’ll automatically drop these keys in your user’s .ssh directory. I made the items I entered into terminal red for ease of understanding.
justin@Ares:~/.ssh$ ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/justin/.ssh/id_dsa):
Enter passphrase (empty for no passphrase): <enter>
Enter same passphrase again: <enter>
Your identification has been saved in /home/justin/.ssh/id_dsa.
Your public key has been saved in /home/justin/.ssh/id_dsa.pub.
The key fingerprint is:
fb:xx:fd:xx:f7:xx:a6:xx:74:xx:7e:xx:6d:xx:86:xx justin@Ares
The key’s randomart image is:
“my little secret”
That created a few things for us. The only one we’re going to need to man handle (sorry ladys, it’s a figure of speech). is the “id_dsa.pub file. This file will need copied to the machines you want to ssh into. It will be saved in each machines ~/.ssh directory as authorized_keys2 (you can ssh into that machine and run ls -l ~/.ssh to check if it’s there.
I did a little rsync tutorial a few months ago, and this is how I moved the new key to each of my networks computers. EVEN those where I don’t have the same login-name. Here is how I moved them around to all the machines (the IP addresses are my own, you’ll have to know your own to make it work for you).
$ ssh -avz ~/.ssh/id_dsa.pub thatuser@192.168.0.69:/home/thatuser/.ssh/authorized_keys2
You will be asked for that user’s password and rsync will plop that dawg in their .ssh directory. So the next time you loginto that machine as “that” user ssh will let you right in and drop you in that users ~/ directory.
To button all this up run a little chmod action on these new files (sudo chmod -v 600 ~/.ssh/authorized_keys2) to keep things on the down low and press on with your ssh ass.
Here’s a command I can now run via ssh with only the sudo password needed for the command.
$ ssh -X 192.168.0.69 ‘conky -a top_left’
Enjoy,
Justin