4 ms·
I find this common "wisdom" or "best practice" questionable. Something to think about: If I use a password, a suitably designed client can have absolutely no t
by userbinator 10y ago
I find this common "wisdom" or "best practice" questionable. Something to think about:
If I use a password, a suitably designed client can have absolutely no trace of my credential after it has been used.
If I use a key/certificate, that credential must be stored somewhere on the client, and even in encrypted form, it exists in persistent storage.
- deleted 10y ago[deleted]
- eli 10y agoIf someone is able to steal my private key file, then they have probably compromised my computer and could just as well install a keylogger.
- userbinator 10y agoConsider the scenario in which your computer is stolen (and might not ever be returned, so whether the attacker installs a keylogger is irrelevant): The fact that a private key file exists suggests that the user is very likely to be using SSH regularly. The fact that an SSH client exists is far less informational (there's one by default on most Linuxes and Mac OS). If I only ever use password authentication with SSH and don't save anything else, not even server keys, the attacker has far less information. That might be important in some scenarios, especially related to anonymity.
- DasIch 10y agoIf your computer is stolen and you don't have full disk encryption, a leaked private key is probably far from the only problem.
- old-gregg 10y agoalexk already addressed your concern: your keys, preferably issued by your org's CA (instead of being generated by you) should be short-lived, oftentimes for the duration of your "work shift". The tools listed above support this.
- lomnakkus 10y agoYou are aware it's usually recommended to have passphrases for keys, yes? Plus, you really should have whole-disk encryption for laptops. (I get the feeling I'm missing something here, but...)
- userbinator 10y agoRegardless of whether the keyfile has a passphrase, the point is that it exists. And FDE also suggests you may be hiding something. Sometimes the best way to make something secure, is to make it look like there is actually nothing to secure.
- tzs 10y ago> And FDE also suggests you may be hiding something. No one needs to bother trying to infer from FDE that I'm hiding something. I will tell them I am if they ask. Financial records, intimate correspondence, and employer trade secrets (I'm authorized to work at home on my personal computer) immediately come to mind and there is probably more. I'm sure I'm not unusual in this regard. Most people have things they are hiding.
- lomnakkus 10y agoIf anyone's targeting your specific laptop for theft they already think that you're hiding something. If some rando steals your laptop they probably have no clue what SSH even stands for.
- vacri 10y agoSecurity-by-obscurity only works alongside other layers. Do you also do things like stop all system logging? Or shell logging? Even with only user-level access, a simple 'history' will show where you're ssh'ing to, regardless of whether you use a keyfile or not.
- galdosdi 10y agoNot these days. FDE is so common and easy to use now, it might well have been an option you blindly hit upon install. And that's just in consumer environments. In corporate environments, in any company with a half-decent infosec department, all employees' computers will simply be required to have FDE, regardless of what they do on the computers.
- Canada 10y agoWhat about your known_hosts? Do you delete that every connection?
- tedunangst 10y agoHashKnownHosts?
- dllthomas 10y agoStill establishes that SSH was being used, which seems to be userbinator's concern.
- dllthomas 10y agoAnd of course if you do, that is weakening you against other kinds of attacks.
- rhizome 10y agoYou're essentially arguing for SSH security to be reduced to the "something you know" prong of multifactor authentication.
- electronvolt 10y agoWhich can (and should) be stored in a way that requires a password to access (ssh supports this, as do most other certificate systems).
- deleted 10y ago[deleted]
- alexk 10y agoThat's why short lived certs are better then just private keys - even if the key is stolen, the system can cut off the access by not issuing the renewed certificate. This makes private key itself to be irrelevant, in fact it can be generated as well once a day for example.
- ebbv 10y agoThis objection is weak. Generate a unique key pair on the client. De-authorize it when you're done or just delete it. If your argument is that your client is untrusted, then typing in your password is a lot more risky than generating a fresh key pair.
- sfifs 10y agoWell you can always keep your keys in a removable drive rather than on persistent storage in your client device. If you can't trust your client device, you probably have bigger issues with either method - for instance, can you trust that the client is not logging all keystrokes?
- walrus01 10y agoWhich is why you generate your private key with a passphrase (which is used exclusively client side in an ssh client) and only store it on HDD, flash or SSD that uses full disk encryption.
- elchief 10y agosmart cards cost like $15
- mercora 10y agoi am somewhat scared to use smart cards because they might break at some point and i am loosing access... if i would use some kind of local ca to provision the keys i could just as well use them directly... so i would need some kind of secured (air gaped and what not) device to provision them. which will be unavailable when i am abroad... all in all it seems to me it doesn't solve more problems than it makes...
- jvoorhis 10y agoThe CA or smart card software is only needed for provisioning smart cards for clients, and is likely to be of little concern for setting up a new server. The card itself stores a non-phishable credential which you can physically secure.
- deleted 10y ago[deleted]
- deleted 10y ago[deleted]
- naner 10y agoYour private key should remain password protected, I don't think anyone here is recommending a passwordless login. Also usually with ssh you are more worried about the remote server being compromised than your local client machine.
- kleim 10y agoIf someone has remote access to your computer then either way you are screwed. Using password or key file won't change anything. If your laptop get stolen, then just remove the corresponding line in your authorized_keys file.
- vbezhenar 10y agoIf the key is encrypted, then it doesn't exist as long as the password is good enough to resist a bruteforce. But password requirements in this case are definitely higher. You can restrict login attempts in the remote ssh machine, but you can't restrict bruteforcing of stolen encrypted key.
- icebraining 10y agoYou can also use bcrypt and adjust the work factor; assuming use of ssh-agent and/or shared connections, you could add a delay of multiple minutes to each try.
- dfc 10y agoI think this "wisdom" or "best practice" is targeted at the overwhelming amount of the population that are concerned with using SSH on a computer they control and are therefore not concerned with leaving footprints behind. Do you frequently use a computer that you don't control?
- galdosdi 10y agoYou must not be aware that you can set a password (which ssh-keygen calls a passphrase) on your private key file. The private key file will be encrypted and without the password will be useless, if your password is strong. Then you get the best of both. Setting a passphrase on your key file is also actually widely considered a "best practice" and "conventional wisdom" ... so maybe those old guys knew something after all...
- userbinator 10y agoI'm perfectly aware that you can and almost always should encrypt the keyfile; the point I'm trying to make is that you still need a keyfile and the existence of that file can itself be a concern in some situations even it it can't be immediately used by an attacker.