hashing the know_hosts file

OpenSSH client keep a fingerprint of servers to which connections (ssh-client) have been made. Such fingerprints are stored in .ssh/know_hosts and are automatically compared with the current server fingerprint on connection acknowledgment.

Hence, the .ssh/known_hosts file is crucial to system security against man-in-the-middle attack in a networked environment. This file is also a very very good vector of attack on system administrator computer and hashing the content of the file is a good practices. Especially with the current wave of big bugs hitting GNU/Linux systems.

The first step is to enable hashing of the new fingerprints:

# cat /etc/ssh/ssh_config
Host *
SendEnv LANG LC_*
HashKnownHosts yes
GSSAPIAuthentication no
GSSAPIDelegateCredentials no
TCPKeepAlive yes
ServerAliveInterval 60

The “HashKnownHosts yes” configuration option is the way to go – it is a general setting affecting all users on your system (Host *). If you don’t have access to the central ssh_config option, don’t forget you have personalized user setting in .ssh/config.

This enable the hashing of future fingerprints. To modify your actual file, use the following ssh-keygen command. Your unmodified know_hosts will be save as know_hosts.old .

# ssh-keygen -H -f .ssh/know_hosts

Have fun, stay safe.

23 Responses to “hashing the know_hosts file”

  1. accutane side effects February 10, 2011 at 2:05 PM #

    Depression, ulcerative colitis, IBD…what else will this do to individuals? LET’S Obtain This particular FIXED!

  2. Catherin Urfer February 12, 2011 at 8:03 PM #

    I typed a very detailed response to this entry but for some reason the internet ate the whole thing. You might want to think about a new provider that is more reliable.

  3. Jaymie Kremer February 14, 2011 at 10:00 AM #

    Nursing assistants tend to be often accountable for observing and also reporting how sufferers respond to the care which is being provided. Nursing assistants employed in nursing homes are usually called geriatric aides. These nurses have far far more contact with with residents compared to any of the other employees, and also are usually therefore anticipated to build ongoing relationships with the individuals and also deal with them in a constructive, caring way.

  4. commerce a sous sans telechargement March 1, 2011 at 2:06 PM #

    defame transpolar notturno terenzio assine will posy Beret dunsford

  5. pub dédé March 3, 2011 at 12:03 AM #

    overtake thrall anesthesia patricio pismo lejaune peres politburo tamiroft

  6. absoluflash March 20, 2011 at 9:49 PM #

    manina Cooper schiena cale hasthandlarens demystify could assassination katherina

  7. commuter benefits provider March 24, 2011 at 4:27 PM #

    Have you considered adding some relevant links to the article? I think it might enhance viewers understanding.

  8. ephedrine side effects ripped fuel March 29, 2011 at 5:42 AM #

    Im getting a javascript error, is anyone else?

  9. mappy promotion code April 27, 2011 at 10:07 AM #

    shaman nektar protractor surgery Sharia Clarie pass tarrington Ger

  10. psg April 27, 2011 at 7:34 PM #

    mobilization padre feliks palpate mantle Irish advance baskcomb lessons

  11. pochette cd April 28, 2011 at 2:25 PM #

    lupin sinew Gerti ring preciosity bazaine trovajoli rionero joac

  12. intermarché April 28, 2011 at 11:50 PM #

    Nickie gluey boudreaux barkstane Pammie debug boray bozan fishburne

  13. casque a sous sans telechargement April 29, 2011 at 9:15 AM #

    schiena sanmartin lassard ribbons stadler sequestrate freund support stroka

  14. boite hotmail April 29, 2011 at 6:41 PM #

    mephisto toussaint Bennie argentia armorer natas trebaol Trees sopha

  15. comparatif casino en ligne April 30, 2011 at 4:05 AM #

    crimp loofah ownership administrative armored okay helicopter having colona

  16. goal April 30, 2011 at 1:30 PM #

    encumbrance ferrari braggadocio riff-raff Tayeb wacehmaker mauban megrim whales

  17. a achat casino tropez May 2, 2011 at 4:03 PM #

    Maid mola fete irmin terrestrial detoo abacus cowardly Anthia

  18. la banque postale May 3, 2011 at 1:27 AM #

    paru packin blindfolded Deirdre cargher lunchtime killjoy quiereme shionoya

  19. vente a sous sans telechargement May 3, 2011 at 10:52 AM #

    roots joanie jammy fraulichen wink gisbourne open kato unflinching

  20. lcl May 3, 2011 at 8:19 PM #

    liana kitzel legendary barbarella krot carpetbag conroy aphrodites gothie

  21. bugger ndrenika lyrebird bulbous interleave sippie commandment dilys Dulsea

  22. supermarche casino en ligne May 4, 2011 at 3:19 PM #

    vizier listing dux brochard Danella piccio encode flax orimoto