X
X
xGRayDxxx2021-03-03 17:38:38
Python
xGRayDxxx, 2021-03-03 17:38:38

Why can't it find SFTP?

When connecting to SFTP using the FTPlib library, it does not find the host, although it is specified correctly (that's for sure, it was also connected via filezilla), of course, there is also access to the Internet.
Host format sftp://test.template.com:0000 (this is just an example, of course not real, but it is of this format)
Tried through test.template. com:0000 , sftp://test.template.com , test.template.com
Code itself:

import ftplib

ftp = ftplib.FTP("host", 22)
print(ftp.login("username", "pass"))


Mistake:
socket.gaierror: [Errno -2] Name or service not known


I tested both on my PC and on python sandboxes , the result is the same.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
HemulGM, 2021-03-03
@HemulGM

SFTP is not FTP for you. These are two completely different technologies, two different protocols.
We take Google and study the question, and only then we ask our questions

D
Dr. Bacon, 2021-03-03
@bacon

google for you docs.paramiko.org/en/stable/api/sftp.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question