Learning Python Network Programming

(Sean Pound) #1

Interacting with Remote Systems


Now, right-click on the folder and then go to the Sharing tab. There are two buttons:
Share and Advanced sharing. You can click on the latter and it will open the
advanced sharing dialog box. Now you can adjust the share permissions. If this share
is active, then you will be able to see this share from your Linux virtual machine. If
you run the following command on your Linux box, then you will see the previously
defined file-share:


$smbclient -L 10.0.2.2 -U WINDOWS_USERNAME%PASSWPRD -W WORKGROUP
Domain=[FARUQUESARKER] OS=[Windows 8 9200] Server=[Windows 8 6.2]


Sharename Type Comment




ADMIN$ Disk Remote Admin
C$ Disk Default share
IPC$ IPC Remote IPC
Share Disk


The following screenshot shows how you can share a folder under Windows 7
as discussed previously:


The preceding file share can be accessed from your Python script by using a
third-party module called pysmb. You can use the pip command-line tool for
installing pysmb:


$ pip install pysmb

Free download pdf