Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Parikhharshal
Creator III
Creator III

Using SSH and .pem file connect to Redshift DB

Hi experts

 

I have a scenario where I want to connect to Redshift db and start reading data from redshift tables using SSH tunnel plus .pem file.

 

Can you please let me know how can I do it?

 

Thanks

Harshal.

Labels (2)
5 Replies
Parikhharshal
Creator III
Creator III
Author

Anyone has got any idea on this? Please share.

 

I tried configuring custom ssh component and built job like this but getting the error:

 

Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.

 

 

Talenduser1
Contributor
Contributor

Did you find the solution for this? I also have similar requirement. Please share what you have done to connect to Redshift through SSH Tunnel

Parikhharshal
Creator III
Creator III
Author

@Gopal  I think current ssh component is faulty.

 

So I implemented the same using following command in .cmd file and scheduled in task scheduler and running all the time on the Talend sevrer. So Talend can SSH anytime into tunnel and connect.

 

ssh -N -L 54321:XXXXXX.rds.amazonaws.com:5432 user-name@ec2-XXXXX.com -i C:/ETL/XXX.pem Username-sol-XXXXX.pem. 

 

Working absolutely fine.

Anonymous
Not applicable

I found here a solution how to use tSSHTunnel or to use the cmd command to use ssh tunnel with private key.

https://stackoverflow.com/questions/53941259/talend-tsshtunnel-usage


ssh.JPG
Parikhharshal
Creator III
Creator III
Author

Hi @aser 

 

What I found out is there were different issues with this component so finally I manahed to write the script on the server which always runs in the background and port will remain open as long as script runs.

 

The powershell script looks like like this:

 

ssh -N -L 54321Smiley Very HappyBservernamewhereyouareconnectingto:5432 ec2-user@whereyouareconnectingfrom -i C:/ETL/test.pem dwuser-bastionhost.pem

 

Hope this makes sense.