ssh key fingerprint information
Blog Yeah, kitt finished writing this at 11:54 on 8 March 2012Use ssh-keygen
with the -l option
(that's a lowercase L). You'll need to specify the -f [file]
option, too, as you could have more than one .pub
file (dsa, rsa, etc.).
dymock[1030]% ssh-keygen -lf ~/.ssh/id_dsa.pub 1024 2a:12:ab:34:cd:56:ef:44:78:aa:9a:bb:dd:cc:66:f8 /home/kitt/.ssh/id_dsa.pub (DSA)
When in doubt, man ssh-keygen
% man ssh-keygen ... -l Show fingerprint of specified public key file. Private RSA1 keys are also supported. For RSA and DSA keys ssh-keygen tries to find the matching public key file and prints its fingerprint. If combined with -v, an ASCII art representation of the key is supplied with the fingerprint. ...
ssh configuration to prevent timeout auto-logouts
Blog Written with a loving hand by kitt some time around 08:49 on 8 March 2012I have a couple remote systems with really short ssh login timeouts. By the time I stand up, walk into the other room to retrieve a reference book and sit back down, the system has logged me out for being idle too long.
By default, the idle auto-logout timeout is set by the administrator in the /etc/ssh_config file. Since most people don't lock their screens before they move away from their computers (though, they really should, and if you have client work on your laptop, you owe it to your client to protect their work by locking your screen every time you leave it), short timeouts will reduce the security risk by auto-logging out idle connections more quickly, reducing the window of opportunity.
I do have the habit of locking my screen as I stand up to move away from it, thanks to Mike Gull. Thanks, Mike!
For one particular system, however, the timeout is too short (it's less than 2 minutes, might be less than one, I haven't timed it).
Rather than changing the config file, I can send null packets to the server letting it know that my connection is still open, that I'm not idle. On the command line, that options is -o
:
% ssh -o ServerAliveInterval=5 bounceout
It is, however, slightly annoying to have to remember that -o
option.
Fortunately, I can save it in the ssh configuration file:
% man ssh ... -F configfile Specifies an alternative per-user configuration file. If a configuration file is given on the command line, the system-wide configuration file (/etc/ssh_config) will be ignored. The default for the per-user configuration file is ~/.ssh/config. ...
Excellent.
One quick
% emacs ~/.ssh/config
later and I have this in my file:
Host bounceout.hodsden.net ServerAliveInterval 5
I could have used an = instead of white space to separate the values, which eliminates the need for double quotes around the value if there is space in the value:
Host bounceout.hodsden.net ServerAliveInterval=5
but my config file is simple enough I don't need to.
And now, no more quick time-outs for that box. Yay!
I also could have used a wild card on that Host parameter. This is a special case that I don't want applied to every server I ssh into, so limiting to one host seems prudent.
Update: If you have aliases in your /etc/host
file for your servers, you will need to use the alias in the Host parameter:
Host bounceout ServerAliveInterval=5
Rally beagle!
Blog Yeah, kitt finished writing this at 17:33 on 28 February 2012Well, it was touch-and-go today with the Bella. She was nauseous and throwing up today (a sign of complete kidney failure) and refusing to eat (good thing I porked her up from 23 to nearly 26 pounds in the last two months). Kris took her to the vet again this afternoon, where she received fluids and anti-nausea medicine. Whether being at the vet pissed her off, or the medicine and all helped, she's rallied and is back home go go going.
Rally beagle FTW!
Ignore .git directories in Apache DOCROOT
Blog Yeah, kitt finished writing this at 13:50 on 28 February 2012Put this in a VirtualHost
config block to make sure git files aren't served by the Apache process:
<Directorymatch "^/.*/\.git/"> Deny from all </Directorymatch>
Won't work in an .htaccess
file.
Rough night
Blog Yeah, kitt finished writing this at 10:36 on 28 February 2012Yesterday was pretty rough for the little girl.
She refused to eat her dinner and had been instead eating clumps of grass from the back yard. When she puked up four grass balls and refused even rice and cottage cheese, Kris took her to the emergency vet. She ended up staying the night as they tried to put fluids and nutrients into her.
And thus begins the heroic measures to extend her life. Well, not so much "heroic" as "expensive."
She's still howling. She's still feisty, refusing to go to the vet this morning and being all huffy. While her quality of life may be decreased, she's still Bella and she still has fight in her. When she's awake, she seems to enjoy walking around the block. Sure, it takes her 30 minutes to go less than half a mile, but, wow, the sniffing she manages in that walk? Yeah, same as the young Bella.
So, not that you can tell in this picture either, but she's still alive, just a little drugged up on painkillers.