Learning Python Network Programming

(Sean Pound) #1

Interacting with


Remote Systems


If your computer is connected to the Internet or a local area network (LAN), then
it's time to talk to the other computers on the network. In a typical home, office, or
campus LAN, you will find that many different types of computers are connected
to the network. Some computers act as the servers for specific services, such as a
file server, a print server, a user authentication management server, and so on.
In this chapter, we will explore how the computers in a network can interact with
each other and how they can access a few services through the Python scripts.
The following task list will give you an overview of the topics that will be
covered in this chapter:



  • Accessing SSH terminals with paramiko

  • Transferring files through SFTP

  • Transferring files with the help of FTP

  • Reading the SNMP packets

  • Reading the LDAP packets

  • Sharing the files with the help of SAMBA


This chapter requires quite a few third-party packages, such as paramiko, pysnmp,
and so on. You can use your operating system's package management tool for
installing them. Here's a quick how-to on installing the paramiko module in Ubuntu
14, python3, and the other modules that are required for understanding the topics
covered in this chapter:


sudo apt-get install python3
sudo apt-get install python3-setuptools
sudo easy_install3 paramiko
sudo easy_install3 python3-ldap
sudo easy_install3 pysnmp
sudo easy_install3 pysmb

Free download pdf