Learning Python Network Programming

(Sean Pound) #1
Chapter 5

In a properly configured LDAP machine, the preceding script will return a result that
will be similar to the following:


$ python 5_5_ldap_read_record.py
[('cn=Faruque Sarker,ou=users,dc=localdomain,dc=loc', {'sn':
['Sarker']})]


Sharing files with SAMBA


In a LAN environment, you will often need to share the files between different types
of machines, such as Windows and Linux machines. The protocol used for sharing
the files and the printers among these machines is either the Server Message Block
(SMB) protocol or its enhanced version called the Common Internet File System
(CIFS) protocol. CIFS runs over TCP/IP and it is used by the SMB clients and
servers. In Linux, you will find a package called Samba, which implements the
SMB protocol.


If you are running a Linux virtual machine within a Windows box with the help of
software, such as VirtualBox, then we can test file sharing among the Windows and
the Linux machines. Let us create a folder at C:\share on the Windows machine as
you can see in the following screenshot:

Free download pdf