SFTP deployment with DSA key

Could not connect to remote server via sftp with private key auth. Trying to use id_dsa key (DSA key).
Obtain "Connection to xxxx failed. Auth fail" error



Of course I can connect through ssh login@my.server.com  (and sftp login@my.server.com) with this key and passphrase. And PHPStorm successfully connects to another server with RSA key
Are there any ideas where to look for solution?
OS: Linux Ubuntu 11.04, latest EAP version of PHPStrom

6 comments
Comment actions Permalink

Hello Dmitry,

Can you please provide SFTP log? Thanks!

Regards,
Kirill

0
Comment actions Permalink

Thanks for quick reply!

2011-06-07 18:26:49,315 [  63697]  DEBUG - t.connections.RemoteConnection - Opening connection to sftp://10.32.211.60:22/
2011-06-07 18:26:49,324 [  63706]   INFO - ins.plugins.webDeployment.sftp - Connecting to 10.32.211.60 port 22
2011-06-07 18:26:49,325 [  63707]   INFO - ins.plugins.webDeployment.sftp - Connection established
2011-06-07 18:26:49,331 [  63713]   INFO - ins.plugins.webDeployment.sftp - Remote version string: SSH-2.0-OpenSSH_5.6
2011-06-07 18:26:49,331 [  63713]   INFO - ins.plugins.webDeployment.sftp - Local version string: SSH-2.0-JSCH-0.1.42
2011-06-07 18:26:49,331 [  63713]   INFO - ins.plugins.webDeployment.sftp - CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
2011-06-07 18:26:49,336 [  63718]   INFO - ins.plugins.webDeployment.sftp - aes256-ctr is not available.
2011-06-07 18:26:49,336 [  63718]   INFO - ins.plugins.webDeployment.sftp - aes192-ctr is not available.
2011-06-07 18:26:49,336 [  63718]   INFO - ins.plugins.webDeployment.sftp - aes256-cbc is not available.
2011-06-07 18:26:49,336 [  63718]   INFO - ins.plugins.webDeployment.sftp - aes192-cbc is not available.
2011-06-07 18:26:49,336 [  63718]   INFO - ins.plugins.webDeployment.sftp - arcfour256 is not available.
2011-06-07 18:26:49,336 [  63718]   INFO - ins.plugins.webDeployment.sftp - SSH_MSG_KEXINIT sent
2011-06-07 18:26:49,336 [  63718]   INFO - ins.plugins.webDeployment.sftp - SSH_MSG_KEXINIT received
2011-06-07 18:26:49,336 [  63718]   INFO - ins.plugins.webDeployment.sftp - kex: server->client aes128-ctr hmac-md5 none
2011-06-07 18:26:49,336 [  63718]   INFO - ins.plugins.webDeployment.sftp - kex: client->server aes128-ctr hmac-md5 none
2011-06-07 18:26:49,342 [  63724]   INFO - ins.plugins.webDeployment.sftp - SSH_MSG_KEXDH_INIT sent
2011-06-07 18:26:49,342 [  63724]   INFO - ins.plugins.webDeployment.sftp - expecting SSH_MSG_KEXDH_REPLY
2011-06-07 18:26:49,352 [  63734]   INFO - ins.plugins.webDeployment.sftp - ssh_rsa_verify: signature true
2011-06-07 18:26:49,353 [  63735]   INFO - ins.plugins.webDeployment.sftp - Host '10.32.211.60' is known and mathces the RSA host key
2011-06-07 18:26:49,353 [  63735]   INFO - ins.plugins.webDeployment.sftp - SSH_MSG_NEWKEYS sent
2011-06-07 18:26:49,353 [  63735]   INFO - ins.plugins.webDeployment.sftp - SSH_MSG_NEWKEYS received
2011-06-07 18:26:49,354 [  63736]   INFO - ins.plugins.webDeployment.sftp - SSH_MSG_SERVICE_REQUEST sent
2011-06-07 18:26:49,355 [  63737]   INFO - ins.plugins.webDeployment.sftp - SSH_MSG_SERVICE_ACCEPT received
2011-06-07 18:26:49,358 [  63740]   INFO - ins.plugins.webDeployment.sftp - Authentications that can continue: publickey,keyboard-interactive,password
2011-06-07 18:26:49,358 [  63740]   INFO - ins.plugins.webDeployment.sftp - Next authentication method: publickey
2011-06-07 18:26:49,376 [  63758]   INFO - ins.plugins.webDeployment.sftp - Disconnecting from 10.32.211.60 port 22
2011-06-07 18:26:49,378 [  63760]   WARN - loyment.ui.WebServerConfigForm - Could not connect to SFTP server at "sftp://10.32.211.60/".
org.apache.commons.vfs.FileSystemException: Could not connect to SFTP server at "sftp://10.32.211.60/".
at org.apache.commons.vfs.provider.sftp.SftpFileProvider.doCreateFileSystem(SftpFileProvider.java:106)
at org.apache.commons.vfs.provider.AbstractOriginatingFileProvider.getFileSystem(AbstractOriginatingFileProvider.java:103)
at org.apache.commons.vfs.provider.AbstractOriginatingFileProvider.findFile(AbstractOriginatingFileProvider.java:82)
at org.apache.commons.vfs.provider.AbstractOriginatingFileProvider.findFile(AbstractOriginatingFileProvider.java:66)
at org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:692)
at org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:620)
at com.jetbrains.plugins.webDeployment.connections.RemoteConnectionPool.createConnection(RemoteConnectionPool.java:120)
at com.jetbrains.plugins.webDeployment.connections.RemoteConnectionManager.openConnection(RemoteConnectionManager.java:105)
at com.jetbrains.plugins.webDeployment.PublishUtils$1$1.run(PublishUtils.java:108)
at com.intellij.openapi.application.impl.ApplicationImpl$6.run(ApplicationImpl.java:375)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:130)
Caused by: org.apache.commons.vfs.FileSystemException: Could not connect to SFTP server at "10.32.211.60".
at org.apache.commons.vfs.provider.sftp.SftpClientFactory.createConnection(SftpClientFactory.java:268)
at org.apache.commons.vfs.provider.sftp.SftpFileProvider.doCreateFileSystem(SftpFileProvider.java:95)
... 16 more
Caused by: com.jcraft.jsch.JSchException: Auth fail
at com.jcraft.jsch.Session.connect(Session.java:452)
at com.jcraft.jsch.Session.connect(Session.java:150)
at org.apache.commons.vfs.provider.sftp.SftpClientFactory.createConnection(SftpClientFactory.java:264)
... 17 more

0
Comment actions Permalink

Probably verbose output from ssh could help (ssh login@mmm.com -v):

debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey                                                                                                                
debug1: Offering RSA public key: /home/dsmirnov/.ssh/id_rsa                                                                                                  
debug1: Authentications that can continue: publickey                                                                                                         
debug1: Offering DSA public key: /home/dsmirnov/.ssh/id_dsa                                                                                                  
debug1: Server accepts key: pkalg ssh-dss blen 434                                                                                                           
debug1: key_parse_private_pem: PEM_read_PrivateKey failed                                                                                                    
debug1: read PEM private key done: type <unknown>                                                                                                            
Enter passphrase for key '/home/dsmirnov/.ssh/id_dsa':                                                                                                       
debug1: read PEM private key done: type DSA                                                                                                                  
debug1: Authentication succeeded (publickey).                                                                                                                
Authenticated to 10.32.211.60 ([10.32.211.60]:22).

0
Comment actions Permalink

Looks like the problem is in Java SSH implementation.
Dmitry, can I ask you to check if this problem was already resolved by manually upgrading to the latest available version of the SSH library? Thanks!

Regards,
  Kirill

0
Comment actions Permalink

Thank you! That works.

0
Comment actions Permalink

Thanks for checking! We will upgrade Jsch in PhpStorm 3.0.

Regards,
Kirill

0

Please sign in to leave a comment.