ssh-add does not make a difference between keys and directories

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

ssh-add does not make a difference between keys and directories

Sebastian Rother
Maybe it's a known Bug but maybe not.
And yes I'm truthly I didn't spend a lot time to search for it.

ssh-add adds SSH-Keys to the SSH-Agent.
But ssh-add dosn't make a difference between directories.

Example:

godfather $ ssh-add /tmp
Enter passphrase for /tmp:
Bad passphrase, try again for /tmp:

godfather $ file /tmp
/tmp: sticky directory
godfather $ ssh-add /    
Enter passphrase for /:
Bad passphrase, try again for /:
Bad passphrase, try again for /:
Bad passphrase, try again for /:
Bad passphrase, try again for /:

godfather $ file /    
/: directory
godfather $

SSH could identify keys via 'file' (ASCII) or even identified such areas by
measuring the entropy, arithemtical mean and counter checking.
The last method would be the better one of course.


Kind regards,
Sebastian