Red Green Software

We take stopped projects and get them going again.

Creating the RSA Key

ssh-keygen -t rsa

This will create the id_rsa and id_rsa.pub files. The id_rsa.pub file located in ~/.ssh is your public key. Copy it to the system you want to automatically login to. See `man ssh-keygen` for more options. Why do I only show RSA keys? Because it's safer then the DSA keys according to the putty developers (see section 8.2.2) . I'm sure that all the bugs in DSA have been fixed by now, including the key generation problems, but why take unnecessary risks?

Public Key Adding Script

#!/bin/sh
# September 23, 2003 (initial)
# Updated August 23, 2006 (updated)
#
# Steve Thielemann
#
# A script file to add ssh key
#
# 1.) Verifies ~/.ssh directory exists, if not creates and
#     fixes permissions.
# 2.) Verifies ~/.ssh/authorized_keys exists, if not creates and
#     fixes permissions.
# 3.) Checks to see if ssh key is already present, if not adds to
#     ~/.ssh/authorized_keys.
#
# dependant on:  grep, touch, chmod, cut
#
if [ -z $1 ]
then
echo "I need the filename of a public key to add."
echo "(The .pub file created from ssh-keygen -t rsa)"
echo "Example:  $0 remote_rsa.pub"
exit
fi
if [ -f $1 ]
then
keyid=`cut -f3- '-d ' < $1`
else
echo "I can't find $1 !"
exit
fi
echo "Using ID $keyid"
# variables to make life easier
sshdir=~/.ssh
keyfile=~/.ssh/authorized_keys
if [ ! -d "$sshdir" ]
then
echo "Making $sshdir"
mkdir "$sshdir"
chmod 700 "$sshdir"
fi
if [ ! -f "$keyfile" ]
then
echo "Creating $keyfile"
touch "$keyfile"
chmod 644 "$keyfile"
fi
grep "$keyid" "$keyfile" > /dev/null
if [ $? = 1 ]
then
echo "Adding key to $keyfile"
cat $1 >> "$keyfile"
else
echo "Key $keyid already present."
fi
# the end

Or: download the auto SSH script .

Notes About the Script

The script doesn't do anything fancy, and once it has been run, adding additional keys is as simple as doing cat id_rsa.pub >> ./ssh/authorized_keys ! But, if the system hasn't been rsa public keyed before, this script will take care of setting all the file permissions correctly.

Configuring SSH to use the RSA Key

In your ~/.ssh/config file, add the following lines: Host nameyoucallsite Hostname 10.0.0.1 (or hostname) IdentityFile ~/.ssh/id_rsa User usernameonsite The hostname, if you set it with an IP address, it will always work (assuming your internet connection is working). If you use a hostname, it will only work if DNS is working. (Hint, if the server you are sshing into is the DNS server for that domain, make sure you have the IP address somewhere just in case!) User is the login name for that box. The IdentityFile is the file that you created, I usually create many keys, one for each project that I am involved in. Once configured, doing `ssh nameyoucallsite` is all that is required to login to the site.

Internet Storm StatusThe Internet Storm Center monitors the state of the Internet, and reports when there are problems due to worms or DOS (Denial Of Service) attacks. 

http://isc.sans.org/infocon.php

What’s that you say? You’ve never been asked that before? I bet you have, but you didn’t hear the question!

Go to any fast food restaurant, order french fries, and you’ll be asked “Would you like some Ketchup?“. That’s the question that you’ll hear. The actual question is, “Would you like the rest of the Ketchup?” Go ahead, answer yes. And here comes the heaping pile of Ketchup you wanted!

I wish I could take credit for having “the rest of the Ketchup”, revealed to the world, but I can’t really. Larry Evans is the person that came up with it originally, and to him I give the rest of the credit!

At one point in time, free actually meant free. But nowadays I find myself more and more frequently not being able to afford the high cost of free. continue reading…

Get Free VMWare Player here

VMWare has a fantastic product (for what it does), allowing you to run other operating systems on top of your Microsoft Windows or Linux OS. It is great for trying out Linux distributions, and the “don’t save changes to the virtual hard drive” option makes Windows fantastic for testing out service packs and giving the viruses a safe system to infect while you figure out how to get rid of them.

continue reading…