Thursday, February 15, 2007

I was just in Vancouver at the Vancouver PHP conference, and it was really amazing.

When I got home, I noticed that my host-key authentication with SSH wasn't working. I knew that there were some files in /etc/ssh that needed to be modified when my Telus internet connection changed it's IP address. But, which files?


root.web 12 [/etc/ssh] # grep 169.253 /etc/ssh/* | cut -d ":" -f 1 | uniq -c
1 /etc/ssh/shosts.equiv
2 /etc/ssh/ssh_known_hosts


This command is neat and simple:

First, "grep" for a bit of the IP address.

Then, cut out the first field, delimiting on colons.

Third, find unique instances and count them.

Neato!