- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2023 07:34 AM
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
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2023 11:46 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2023 11:34 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2023 11:46 AM
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.

