Peer-to-Peer Networks
Click here to view exercise as a PDF instead.
Sharing files and folders between Windows and Linux systems on peer-to-peer (p2p) networks.
Overview
The purpose of this exercise is to introduce how computer systems can share information (files and folders) by one system sharing a folder and letting onther systems access that folder within a subnet.
Learning Objectives
In this exercise, you wil learn how to share folders on Windows and Linux systems with other Windows and Linux systems.
NOTE: Your "PersonalVolume" should be mounted on the LINUX Desktop for the following to work. If it is not, then open up the file manager and mount it (or Double-Click it). Verify that the "PersonalVolume folder is located on the computer (root drive) at /media/admin/.
If your "PersonalVolume is mounted on the Desktop, but not contained within "/media/admin", then it might be mounted in "/mnt/. You can verify this by executing "ls /mnt" within a terminal window. If this is the case, “un”mount the PersonalVolume as follows:
sudo umount -f "/media/admin/PersonalVolume |
Then mount it again by going to PersonalVolume using the File Manager and double clicking on “PersonalVolume”.
1. Change permissions on secondary storage
sudo chmod -R 777 "/media/admin/PersonalVolume |
2. Create folder on secondary storage
mkdir "/media/admin/PersonalVolume/share" |
3. Install SAMBA
sudo apt-get update sudo apt-get install samba |
4. Edit the SAMBA smb.conf file
cd /etc/samba/ sudo rm smb.conf sudo touch smb.conf sudo nano smb.conf |
Add the following text into the smb.conf file
[share] path = "/media/admin/PersonalVolume/share" browseable = yes read only = no guest ok = yes |
Then press ctrl+x then type “y” then hit enter.
5. add smbuser by the command
sudo smbpasswd -a admin |
(username must be the user on the LINUX os - i.e. admin)
6. start the smbd and nmbd services
sudo service smbd start sudo service nmbd start |
1. From within Windows File Explorer, enter the location \\10.0.10.21
2. Right-button click on the shared folder and select “Map network drive…”
3. Choose a drive letter and click on “Finish”
1. Create folder on secondary storage using the Commamd prompt.
d: cd / md share |
2. Set properties of the shared folder to be shared
- Right-button click on folder within file explorer
- Select “properties”
- Choose the “Sharing” tab on the “Properties” dialog box.
- Click on the "Share…" button
- Click on the down arrow to Select “Everyone”
- Click the Add button
- Change the permission Level to Read/Write to share
- Click on the "Share" button
- Then click on “Done” and click on “Close”
NOTE: Your "PersonalVolume should be mounted on the LINUX Desktop for the following to work. If it is not, then open up the file manager and mount it (or Double-Click it). Verify that the "PersonalVolume folder is located on the computer (root drive) at /media/admin/.
If your "PersonalVolume is mounted on the Desktop, but not contained within "/media/admin", then it might be mounted in "/mnt/. You can verify this by executing "ls /mnt" within a terminal window. If this is the case, “un”mount the PersonalVolume as follows:
sudo umount -f "/media/admin/PersonalVolume |
Then mount it again by going to PersonalVolume using the File Manager and double clicking on “PersonalVolume”.
1. Install CIFS
sudo apt-get update sudo apt-get install cifs-utils |
2. Create a directory "share" in the PersonalVolume
3. Mount the WINDOWS shared folder
sudo mount.cifs //10.0.10.11/share “/media/admin/PersonalVolume/share” -o user=admin rw file_mode=777 dir_mode=777 |
4. Create by editing a new file (i.e. filename) using nano
sudo nano “/media/admin/PersonalVolume/share/filename" |
5. Check it out on the Windows VM
6. Now delete your share
sudo umount -f “/media/admin/PersonalVolume/share/filename” |

CyberExplorations Exercises by Glenn S. Dardick is licensed under a Creative Commons Attribution 4.0 International License.