简体   繁体   中英

connecting to an SFTP server via python

I've been stack for a few days now. I'm wondering if anyone can help me with any suggestions on how to connect to the sFTP server below. The python code I've tried is as follows:

import pysftp

with pysftp.Connection(host ='https://api1.datasource.eex-group.com ', username = 'blablabla', password ='blablabla') as sftp:
    
    print ('Connected!')

When that didn't work, I tried this:

import requests

r = requests.get('https://api1.datasource.eex-group.com', auth=(' username', 'password')) 

Thanks in advance!

You can try this:

import pysftp
cnopts = pysftp.CnOpts()
cnopts.hostkeys = None   
with pysftp.Connection(host ='https://api1.datasource.eex-group.com ', username = 'blablabla', password ='blablabla', cnopts=cnopts) as sftp:

print ('Connected!')

Else here are a few solutions to this problem: "No hostkey for host ***** found" when connecting to SFTP server with pysftp using private key Verify host key with pysftp "No hostkey for... found" in pysftp code even though cnopts.hostkeys is set to None

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM