Correctly honor IdentityFile from ~/.ssh/config
JSch offers all identities available within the JSch object used to
create a Session. In order to offer only a specific IdentityFile
to the remote server we must create a unique JSch with only that
one identity loaded. However, we also want to cache the key once
it has been decrypted, so that repeated uses of a single file from
the same JVM do not cause repeated passphrase prompts.
The SshConfigSessionFactory now loads only the default SSH keys
(~/.ssh/identity for SSH1, ~/.ssh/{id_rsa,id_dsa} for SSH2) into
the default JSch. If a Host block in ~/.ssh/config selects some
other IdentityFile then we create a unique JSch instance for the
key, and copy over the same known hosts table.
Fix issue 35 (Correctly honor IdentityFile in ~/.ssh/config)
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>