Skip to content

sachin-007/Linux-Based-File-Server-Using-Samba

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Linux Based File Server Using Samba

Overview

This project sets up a Linux-based file server using Samba, allowing file sharing across a network. Samba enables Linux systems to communicate with Windows systems using the SMB/CIFS protocol.

Prerequisites

  • A Linux machine (e.g., Ubuntu) with root or sudo access.
  • Basic knowledge of the Linux command line.

Installation and Configuration

1. Install Samba

Run the following commands to install Samba:

# Update the package list
sudo apt update

Install Samba

sudo apt install samba

2. Configure Samba

Backup the Original Configuration File:

sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak

Edit the Samba Configuration File:

sudo nano /etc/samba/smb.conf

[Shared] path = /srv/samba/shared browseable = yes writable = yes guest ok = no read only = no create mask = 0644 directory mask = 0755

3. Create the Shared Directory

sudo mkdir -p /srv/samba/shared
sudo chmod 2775 /srv/samba/shared
sudo chown nobody:nogroup /srv/samba/shared

4. Create Samba Users

1. Add a New User to the System

sudo adduser sambauser

2. Set a Samba Password for the User:

sudo smbpasswd -a sambauser

5. Adjust Permissions

#Set Directory Ownership and Permissions

sudo chown sambauser:sambauser /srv/samba/shared
sudo chmod 2775 /srv/samba/shared

6. Adjust Permissions

#Restart the Samba Service:

sudo systemctl restart smbd

#Verify Samba Status:

sudo systemctl status smbd

6. Access the Shared Directory

##From Another Linux Machine: #Use smbclient to access the shared directory:

smbclient //server-ip/Shared -U sambauser

#Replace 'server-ip' with the IP address of your Samba server ##From a Windows Machine: #Open File Explorer and enter the server’s IP address:

\\server-ip\Shared

###8. Automate Samba Service on Startup ##Enable Samba to Start on Boot:

sudo systemctl enable smbd

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published