Session 2: Managing Common Storage for Students & Security Configuration
Intranet-Based File Storage:
Overview:
- How to set up shared folders on the local network (Intranet), accessible by all students with unique logins.
- Linux: Configure Samba for file sharing on the intranet.
Why Use Intranet-Based File Storage?
- Provides a secure and controlled environment for students to access and share files.
- Eliminates dependency on external cloud storage, reducing security risks.
- Enhances collaboration and ensures easy monitoring of access and file changes.
Basic Samba Configuration:
- Install Samba:
sudo apt update sudo apt install samba - Create a shared directory:
sudo mkdir -p /srv/samba/shared sudo chmod 777 /srv/samba/shared - Edit Samba configuration file:
Add the following lines at the end:
sudo nano /etc/samba/smb.conf[SharedFolder] path = /srv/samba/shared browseable = yes writable = yes guest ok = no valid users = @students - Create a Samba user group:
sudo groupadd students - Add students to the group and set Samba password:
If you get an error like
sudo usermod -aG students student1 sudo smbpasswd -a student1usermod: user 'student1' does not exist, create the user first:Then re-run thesudo useradd -m student1 sudo passwd student1usermodandsmbpasswdcommands. - Restart Samba service:
sudo systemctl restart smbd
Testing Samba Configuration:
- Verify Samba Service:
sudo systemctl status smbd - Check Shared Folder Permissions:
ls -ld /srv/samba/shared - Test Access from Another System:
- On Windows, open File Explorer and enter
\\<server-ip>\SharedFolderin the address bar. - On Linux, use the
smbclientcommand:smbclient -U student1 -L //<server-ip>/SharedFolder
- On Windows, open File Explorer and enter
By following these steps, administrators can ensure smooth and secure user and storage management for students.