Skip to content

Instantly share code, notes, and snippets.

@elskwid
Created March 7, 2012 18:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elskwid/1995048 to your computer and use it in GitHub Desktop.
Save elskwid/1995048 to your computer and use it in GitHub Desktop.
Display the fingerprints for all your public keys
#! /usr/bin/ruby
home_dir = ENV["HOME"]
ssh_dir = "#{home_dir.strip}/.ssh/*.pub"
puts "Checking #{ssh_dir} ..."
puts
Dir["#{home_dir.strip}/.ssh/*.pub"].each do |pk|
puts "Fingerprint for #{pk}"
fingerprint = `ssh-keygen -lf #{pk}`
puts " #{fingerprint.strip}"
puts
end
puts "All done."
@jtmkrueger
Copy link

AWESOME!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment