Re: [jclouds] Add ssh-agent support via jsch agentproxy (#312)

2014-04-01 Thread psiniemi
We can depend on core directly, but ```jsch.agentproxy.jsch``` brings in ```com.jcraft.jsch.agentproxy.RemoteIdentityRepository``` which is the glue between the agent and jsch and analogously ```jsch.agentproxy.sshj``` brings in ```com.jcraft.jsch.agentproxy.sshj.AuthAgent``` which is the glue

Re: [jclouds] Add ssh-agent support via jsch agentproxy (#312)

2014-03-26 Thread psiniemi
I think the whole authentication login with these ssh connections needs a rethink at some point (hopefully not with this pull request though). The way I, as a user, would like it to work is that I just pile on authentication methods that have some hope of succeeding and then when connecting we

Re: [jclouds] Add ssh-agent support via jsch agentproxy (#312)

2014-03-26 Thread psiniemi
@@ -63,9 +77,14 @@ public Factory(ProxyConfig proxyConfig, BackoffLimitedRetryHandler backoffLimite @Override public SshClient create(HostAndPort socket, LoginCredentials credentials) { - SshClient client = new JschSshClient(proxyConfig,

Re: [jclouds] Add ssh-agent support via jsch agentproxy (#312)

2014-03-26 Thread psiniemi
Case insensitive now. --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/312#issuecomment-38771519

Re: [jclouds] Add ssh-agent support via jsch agentproxy (#312)

2014-03-25 Thread psiniemi
Squashed the commits since they didn't add any information and got rid of the last pesky checkstyle violation. Ended up being a missing newline at the end of a file - just couldn't see that in the UI. Had to log into the jenkins server and dig out the xml report to see that. Anyway this single

Re: [jclouds] Add ssh-agent support via jsch agentproxy (#312)

2014-03-25 Thread psiniemi
@@ -156,6 +157,15 @@ public String getPrivateKey() { } /** +* @return true if there is a private key attached that is not encrypted +*/ + public boolean hasUnencryptedPrivateKey() { + return getPrivateKey() != null + !getPrivateKey().isEmpty() +

Re: [jclouds] Add ssh-agent support via jsch agentproxy (#312)

2014-03-25 Thread psiniemi
byte[] privateKey = loginCredentials.getPrivateKey().getBytes(); jsch.addIdentity(loginCredentials.getUser(), privateKey, null, emptyPassPhrase); + } else { The checkArgument above makes the resulting else branch impossible to reach... --- Reply to this email

Re: [jclouds] Add ssh-agent support via jsch agentproxy (#312)

2014-03-22 Thread psiniemi
@@ -128,23 +132,44 @@ public JschSshClient(ProxyConfig proxyConfig, BackoffLimitedRetryHandler backoff this.user = checkNotNull(loginCredentials, loginCredentials).getUser(); this.host = checkNotNull(socket, socket).getHostText(); checkArgument(socket.getPort() 0, ssh

Re: [jclouds] Add ssh-agent support via jsch agentproxy (#312)

2014-03-22 Thread psiniemi
} sessionConnection = SessionConnection.builder().hostAndPort(HostAndPort.fromParts(host, socket.getPort())).loginCredentials( loginCredentials).proxy(checkNotNull(proxyConfig, proxyConfig)).connectTimeout(timeout).sessionTimeout(timeout).build(); }

Re: [jclouds] Add ssh-agent support via jsch agentproxy (#312)

2014-03-22 Thread psiniemi
@@ -67,5 +70,19 @@ public SshClient create(HostAndPort socket, LoginCredentials credentials) { injector.injectMembers(client);// add logger return client; } + + @Override + public boolean existsSshAgent() { + try { Could do that (reuse

Re: [jclouds] Add ssh-agent support via jsch agentproxy (#312)

2014-03-22 Thread psiniemi
@@ -128,23 +132,44 @@ public JschSshClient(ProxyConfig proxyConfig, BackoffLimitedRetryHandler backoff this.user = checkNotNull(loginCredentials, loginCredentials).getUser(); this.host = checkNotNull(socket, socket).getHostText(); checkArgument(socket.getPort() 0, ssh

Re: [jclouds] Add ssh-agent support via jsch agentproxy (#312)

2014-03-22 Thread psiniemi
+exception + conflictingDependencies +dependency + groupIdcom.jcraft/groupId + artifactIdjsch.agentproxy.core/artifactId + version0.0.7/version +/dependency +

Re: [jclouds] Add ssh-agent support via jsch agentproxy (#312)

2014-03-22 Thread psiniemi
byte[] privateKey = loginCredentials.getPrivateKey().getBytes(); jsch.addIdentity(loginCredentials.getUser(), privateKey, null, emptyPassPhrase); + } else { + Connector con = JschSshClient.getSSHAgentConnector(); Where should that code go? Interfaces in

Re: [jclouds] Add ssh-agent support via jsch agentproxy (#312)

2014-03-21 Thread psiniemi
Now there is duplicated code in the factories, but I guess they should be totally independent anyways. --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/312#issuecomment-38266301

Re: [jclouds] Add ssh-agent support via jsch agentproxy (#312)

2014-03-21 Thread psiniemi
Would be nice to get the jenkins conf you run to get these so I could test these myself. Pure mvn clean install gives me no errors. --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/312#issuecomment-38277678

Re: [jclouds] Add ssh-agent support via jsch agentproxy (#312)

2014-03-21 Thread psiniemi
Sounds great :) --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/312#issuecomment-38292692

Re: [jclouds] Add ssh-agent support via jsch agentproxy (#312)

2014-03-19 Thread psiniemi
Uh sorry, we use our fork for our development so I pulled in the current jclouds master. Didn't realized they would come into this pull request... I'll try and clean that up. --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/312#issuecomment-38050175

Re: [jclouds] Add ssh-agent support via jsch agentproxy (#312)

2014-03-19 Thread psiniemi
Now it only has only my commits on top of the fork. Should I try and rebase? The master I last pulled had no conflicts... --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/312#issuecomment-38053679

[jclouds] Add ssh-agent support via jsch agentproxy (#312)

2014-03-11 Thread psiniemi
ssh-agent is a more secure way of providing private ssh keys to ssh connections since an attacker would have to have access to the memory of the client to get access to the unencrypted key. Keys without encryption are accessible on the disk. You can merge this Pull Request by running: git

Re: [jclouds] Add ssh-agent support via jsch agentproxy (#312)

2014-03-11 Thread psiniemi
I can probably make another pull request for the agent support for sshj. There is at least an example of sshj using the same agent proxy. --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/312#issuecomment-37311936

Re: [jclouds] Add ssh-agent support via jsch agentproxy (#312)

2014-03-11 Thread psiniemi
Added the sshj bits. Works for me at least ;) --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/312#issuecomment-37317712

Re: [jclouds] Add ssh-agent support via jsch agentproxy (#312)

2014-03-11 Thread psiniemi
Might be worth mentioning that I had no way of testing this on a windows client. Pageant should work, but I have no way of verifying that... --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/312#issuecomment-37329118