March 2019
Beginner
490 pages
12h 40m
English
SSH can be used to securely transfer files between two computer nodes. The protocol that's used in this case is the secure file transfer protocol (SFTP). The Python paramiko module will supply the classes that are required to create the SFTP session. This session can then perform a regular SSH login:
ssh_transport = paramiko.Transport(hostname, port)ssh_transport.connect(username='username', password='password')
The SFTP session can be created from the SSH transport. The paramiko working in the SFTP session will support the normal FTP commands, such as the get() command:
sftp_session = paramiko.SFTPClient.from_transport(ssh_transport)sftp_session.get(source_file, target_file)
As you can see, the SFTP get command requires ...
Read now
Unlock full access