SFTP with private key

One Star

SFTP with private key

Hi,
I have a private key pait with my server generated by PuTTYGen which work well with WinSCP.
The key was generated using SSH-2 RSA and it's called P_Key.ppk
I am trying to set that up with TOS 3.2, however it does not seem to like the key: the error is the following:
Exception in component tFTPPut_1
com.jcraft.jsch.JSchException: invalid privatekey: E:/Download/P_key.ppk
at com.jcraft.jsch.IdentityFile.<init>(IdentityFile.java:210)
at com.jcraft.jsch.IdentityFile.newInstance(IdentityFile.java:135)
at com.jcraft.jsch.IdentityFile.newInstance(IdentityFile.java:130)
at com.jcraft.jsch.JSch.addIdentity(JSch.java:200)
at com.jcraft.jsch.JSch.addIdentity(JSch.java:194)
at tos_ivigate.test_sftp_0_1.TEST_SFTP.tFTPPut_1Process(TEST_SFTP.java:208)
at tos_ivigate.test_sftp_0_1.TEST_SFTP.runJobInTOS(TEST_SFTP.java:471)
at tos_ivigate.test_sftp_0_1.TEST_SFTP.main(TEST_SFTP.java:383)
Thanks for your help
Regards
Yann
Community Manager

Re: SFTP with private key

Hello Yann
I got the same problem, please report a bug on bugtracker.
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: SFTP with private key

Hi,
Even I am getting the error com.jcraft.jsch.JSchException: invalid privatekey.
Did anyone find solution for the private key format of .ppk extension
Thanks.
Regards,
Sandeep
One Star

Re: SFTP with private key

I've been trying to use ssh from within ant, and got that exception. http://www.bob-team.de/wordpress/2010/01/02/ant-und-ssh helped.. Load the .ppk into PuttyGen, use the Conversions menu (not one of the dialog buttons) to export it in OpenSSH format (I saved it as id_rsa_openssh.ppk) and use that key instead. Works for me.
One Star

Re: SFTP with private key

Hi,
Try using a "*.key" file generated for your .ppk file instead.
It works I guess. Just worth the try.
Six Stars

Re: SFTP with private key

It's the way how putty generate key files. As mentioned above you schould use conversion functions of puttygen and export file as OpenSSHKey and then it schould work.
On the other hand when you generate keys directly on you unix like system using OpenSSH utility ssh-keygen, you avoid these issues. ...I think
Best regards,
archenroot
One Star

Re: SFTP with private key

Hi All,
I am getting the below exception while creating the Job by using tFTPconnection component .
Can some one please help on this?
Exception in component tFTPConnection_1
java.net.SocketException: Permission denied: connect
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at com.enterprisedt.util.proxy.PlainSocket.createPlainSocket(PlainSocket.java:102)
at com.enterprisedt.net.ftp.FTPControlSocket.<init>(FTPControlSocket.java:355)
at com.enterprisedt.net.ftp.FTPClient.connect(FTPClient.java:958)
at testproject.test_job_0_1.Test_Job.tFTPConnection_1Process(Test_Job.java:298)
at testproject.test_job_0_1.Test_Job.runJobInTOS(Test_Job.java:517)
at testproject.test_job_0_1.Test_Job.main(Test_Job.java:385)
Thanks.
One Star

Re: SFTP with private key

You don't have permissions to connect to the destination.
One Star

Re: SFTP with private key

Hi, 
While sending a file via tFTPPut I am getting the permission denied error as below.. I have given all the permissions to the required destination folder which is located in the one of the dev servers.
What do I need to do in order to use the tFTPPut functionality? Any help is appreciated.
Exception in component tFTPPut_1
3: Permission denied, file: /Test_Dir/Test_file.txt
at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2297)
at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:1750)
at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:1767)
at com.jcraft.jsch.ChannelSftp.stat(ChannelSftp.java:1724)
at talend_project.testjob4_0_1.TestJob4.tFTPPut_1Process(TestJob4.java:474)
at talend_project.testjob4_0_1.TestJob4.runJobInTOS(TestJob4.java:752)
at talend_project.testjob4_0_1.TestJob4.main(TestJob4.java:620)
Four Stars

Re: SFTP with private key

Whether the respective user also has the permissions? have you tried with the same configuration using a client?
Vaibhav
One Star

Re: SFTP with private key

Vaibhav,
Yes the username being used has all the permissions. In fact those credentials are working fine from other ETL tool.
More info.. we have installed the ssh keys for the other ETL tool in our dev servers... so do I need to install the same for Talend as well.. if yes, how can I obtain those keys?
Four Stars

Re: SFTP with private key

You can also use batch files using tsystem component to perform operations...
Check similar discussion at http://www.talendforge.org/forum/viewtopic.php?id=26394

Vaibhav