cancel
Showing results for 
Search instead for 
Did you mean: 
Warehousing & Analytics
cancel
Showing results for 
Search instead for 
Did you mean: 

can you help me with connection between databricks and sftp file using paramiko??

115412
New Contributor

https://community.databricks.com/s/question/0D58Y00009fClizSAC/ssh-connection-with-paramiko i read in this post that you can help me with that problem, please can you give me more advice what i have to do to connect to an sftp through ssh

1 ACCEPTED SOLUTION

Accepted Solutions

here is a sample code you can try:

transport = paramiko.Transport((host, port))
transport.connect(None, username, password)
sftp_path =sftp_path + sftp_file_name
sftp = paramiko.SFTPClient.from_transport(transport)
sftp.get(sftp_path, replaced_local_path + flat_file_name)

please ensure the all the variables are correctly defined and the connection to the host server is open.

View solution in original post

2 REPLIES 2

ZhengHuang
New Contributor III

Hi!

Could you please let me know what your current blocker is? Are you looking for a code snippet that can help you get file through sftp? Or if you are looking for the spark config that whitelist the port? Or if you are blocked by some other error?

here is a sample code you can try:

transport = paramiko.Transport((host, port))
transport.connect(None, username, password)
sftp_path =sftp_path + sftp_file_name
sftp = paramiko.SFTPClient.from_transport(transport)
sftp.get(sftp_path, replaced_local_path + flat_file_name)

please ensure the all the variables are correctly defined and the connection to the host server is open.

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.