Chapter 7: Interacting with FTP, SSH, and SNMP Servers

  1. How do we connect to an FTP server using the ftplib module through the connect() and login() methods?

ftp = FTP() ftp.connect(host, 21) ftp.login(‘user’, ‘password’)

  1. What method of the ftplib module allows it to list the files of an FTP server?

FTP.dir()

  1. Which method of the Paramiko module allows us to connect to an SSH server and with what parameters (host, username, password)?

ssh = paramiko.SSHClient() ssh.connect(host, username=’username’, password=’password’)

  1. Which method of the Paramiko module allows us to open a session to be able to execute commands subsequently?

ssh_session = client.get_transport().open_session()

  1. How do we log in to an SSH server with an RSA ...

Get Mastering Python for Networking and Security now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.