ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Hack:   Quick Logins with ssh Client Keys
Subject:   Don't use plaintext keys for interactive logins
Date:   2003-04-07 09:43:31
From:   anonymous2
There's no reason to use a plaintext (passwordless) key for interactive logins, ever. Despite what the author says, a passwordless key is NOT "the same" level of security as a password, since the key sits ON DISK, unencrypted, and a password does not. A better analogy would be putting your sensitive login password into a file named "StealMe.txt". Instead, use a strong passphrase and run ssh-agent to avoid the need to type passwords. For interactive use, this is a far better solution: now an attacker would need TWO secrets (your key and your passphrase) to impersonate you, and you still get passwordless logins.


Also the method of transferring your public key to the server (scp .ssh/id_rsa.pub server:.ssh/authorized_keys2) is not good. Keys should be *appended* to the file, not overwrite the file, in case the file exists. (Yes, I know this hack is just for setting up your first key, but a novice might easily repeat the command, overwriting an existing key file.) Finally, authorized_keys2 is deprecated in favor of authorized_keys in recent versions of OpenSSH. (And of course you should always run a recent version of an important security product like this.)


1 to 1 of 1
1 to 1 of 1