Course Home | Syllabus | Assignments | Schedule | Readings | Grades | Submissions | [print]
Windows share
- Spin up a Windows server 2019 instance
- If you want it to keep the same ip across reboots, you could add a Elastic IP to it.
- Enable the file server role
- Add a new volume to the windows machine (3G)
- Open up disk management
- right click on new disk and set it to
online
- Initialize it (also with a right click)
- select MBR
- right click on new disk and set it to
- Create a new simple volume using the simple volume wizard
- use 1500 MB , assign it a drive letter, format as NTFS
- use the remaining space, assign it a drive letter, NTFS
- Share both new volumes
- the first one should be shared as
movies
- the second should be shared as
music
- the first one should be shared as
- Open port 445 (SMB) in your security group, to allow traffic from your linux instance to connect.
- create a new user (we will use this user account to connect to the share) (I used
fred
)
Linux client
On a Ubuntu client, install smbclient
.
- View share with something like:
smbclient -L //52.23.177.244/movies -U fred
- could mount with something like:
sudo mount -t cifs -o vers=3,username=fred,password=fredspass123$ '//52.23.177.244/movies' /mnt
- You might need to tinker with share and permissions for the user to be able to write files.
Persist in fstab
No point doing this part if the above client failed!!
- install
cifs-utils
Create an /etc/win-credentials file with the following content:
username=fred password=1francom$
Make sure it is owned by root and chmod 600.
Then test a mount command like:
sudo mount -t cifs -o credentials=/etc/win-credentials //52.23.177.244/movies /mnt/
(replace with your ip of windows machine)
My fstab entry looked something like:
//52.23.177.244/movies /mnt/ cifs credentials=/etc/win-credentials,file_mode=0755,dir_mode=0755 0 0
To pass off
Demonstrate that you have mounted BOTH of your volumes that you created to your Linux machine and that you can create files in the volumes FROM your linux machine.
Last Updated 04/02/2021