I created a complete FTP library some time ago. Now I want to connect to an SFTP server. As far as I found out in my research this is not possible using ftplib. Nevertheless I tried to connect to an SFTP only server and it worked without any problems. No error and no exception!
Now I'm a bit confused as I'm not sure if this really is a secure connection (which is important for this application). Especially as I could not find similar cases online. Which brings me to the following questions:
- How can I find out if the connection is encrypted? (current status: It's not encrypted)
- If the connection is not encrypted: How can I support SFTP without having to recode my complete library?
This is the base code I use:
server = 'host-adress'
user = 'username'
password='password'
ftp = FTP(server)
ftp.login(user,password)
All operations like up and downloading files work just fine.
According to my host the server is configured as SFTP.
Logging returns this as result:
*cmd* 'USER username'
*put* 'USER username\r\n'
*get* '331 Password required for username\n'
*resp* '331 Password required for username'
*cmd* 'PASS ********'
*put* 'PASS ********\r\n'
*get* '230 User username logged in\n'
*resp* '230 User username logged in'