Verify host key with pysftp

前端 未结 9 1045
北海茫月
北海茫月 2020-11-22 08:33

I am writing a program using pysftp, and it wants to verify the SSH host Key against C:\\Users\\JohnCalvin\\.ssh\\known_hosts.

Using PuTTY, the terminal

9条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-22 08:56

    Try to use the 0.2.8 version of pysftp library. $ pip uninstall pysftp && pip install pysftp==0.2.8

    And try with this:

    try:
        ftp = pysftp.Connection(host, username=user, password=password)
     except:
        print("Couldn't connect to ftp")
        return False
    

    Why this? Basically is a bug with the 0.2.9 of pysftp here all details https://github.com/Yenthe666/auto_backup/issues/47

提交回复
热议问题