You have found your next IT professional

Category: Linux

Bridging the Linux-Windows Gap

Linux to windows network share with samba

Creating a shared folder on a Linux machine and accessing it from Windows machines on the same network involves setting up Samba on the Linux machine and configuring the Windows machine to access the shared folder. This is because Linux doesn’t have Server Message Block(SMB) natively.

Here is a step-by-step procedure:

Install Samba on the Linux machine

Open a terminal window.

Update the package list by running:

sudo apt update

Linux to windows network share with samba

Install Samba by running:

sudo apt install samba

Linux to windows network share with samba

Create a shared folder

In the terminal, create a new directory for sharing:

mkdir /path/to/shared/folder

Linux to windows network share with samba

Change the ownership of the shared folder to the ‘nobody’ user and ‘nogroup’ group:

sudo chown nobody:nogroup /path/to/shared/folder

Linux to windows network share with samba

Set the appropriate permissions:

sudo chmod 775 /path/to/shared/folder

Linux to windows network share with samba

Configure Samba

Create a backup of the original Samba configuration file:

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

Linux to windows network share with samba

Open the Samba configuration file in a text editor:

sudo nano /etc/samba/smb.conf

Linux to windows network share with samba

Add the following configuration block to the end of the file:

[SharedFolder]

path = /path/to/shared/folder

available = yes

valid users = @users

read only = no

browsable = yes

public = yes

writable = yes

Replace ‘SharedFolder’ with the name for your shared folder and /path/to/shared/folder with the path of the shared folder.

Linux to windows network share with samba

Save the changes and exit the text editor (Ctrl + X, then Y, then Enter in nano).

Test the Samba configuration for any syntax errors:

sudo testparm

Linux to windows network share with samba

Restart the Samba service:

sudo systemctl restart smbd

Linux to windows network share with samba

Configure the firewall (optional, if using a firewall)

Allow samba through the firewall:

sudo ufw allow samba

Linux to windows network share with samba

Enable the firewall, if not already enabled:

sudo ufw enable

Access the shared folder from a Windows machine

On the Windows machine, open File Explorer.

Click in the path field near the top.

Enter:

\\<ip address of Linux machine>\<name of shared folder>

Linux to windows network share with samba

Press Enter

Enter the Linux machine’s ‘nobody’ user credentials, if prompted (the password is typically left blank).

You should now be able to access the shared folder on the Linux machine from the Windows machines on the same network.

Linux to windows network share with samba

In conclusion, sharing files between Linux and Windows machines is a crucial aspect of working in a multi-platform environment. By following the steps provided in this guide, you can seamlessly set up a shared folder on your Linux machine and access it from Windows machines on the same network. Samba serves as an effective bridge between these two operating systems, enabling smooth file sharing and collaboration. With a properly configured shared folder, you can enjoy the benefits of cross-platform collaboration and improve the overall efficiency of your network.

Basic Linux Commands

If you are just getting started in Linux then these commands should be useful.

File System:

ls     : listing

cd     : change directory

cat     : concatenate

pwd     : print working directory

find    : find stuff    https://tryhackme.com/room/thefindcommand

grep    : find a value within a file. i.e. IP address

man      : manual

help    : help. More info than manual

touch  : create file

mkdir  : create directory/folder

cp           : copy (needs destination too)

scp    : secure copy

mv    : move

rm    : remove (need -R to remove directory)

file    : determine the type of file

echo    : output

nano    : text editor

vim    : advanced text editor

wget    : download from internet

strings: look for strings in a file

chmod: change mode/permissions

Operators:

&    : allows you to run commands in the background of your terminal

&&    : allows you to run multiple commands together in one line of your terminal

>    : direct output elsewhere

>>    : as above but appends so no overwriting

Switches

su    : switch user

l    : login

Common Directories

etc     : stores system files for OS

var    : variable data

root     : home directory for ‘root’ user

tmp    : temporary. wiped when session ended.

Processes

ps        : list processes

ps aux        : list all processes

top        : show all processes in live table

kill        : stop process

systemctl    : interact with systemd

ctrl z        : background process

fg        : foreground process

Automation

cron    : process to execute crontabs. Time based. https://crontab-generator.org/

© 2025 timnott-it

Theme by Anders NorénUp ↑