Community-driven coverage of elementary OS — news, guides & forums
Dark abstract low-poly geometric landscape with layered triangular facets in deep navy, charcoal, and muted teal, illuminated by a soft electric-blue glow near the horizon

News roundups, tutorials, application guides, and forums — built by users, for users of the elegant Linux distribution.

elementary weekly
#20
Latest roundup · 18 Apr 2015
Freya Release
Final
Covered in weekly #19 & #20
Forum Topics
Active
Installation, customization & more

How to Set Up Samba Shares on elementary OS for Windows

Windows can share files with elementary OS through Server Message Block (SMB), and Samba is the Linux service that provides it. With SMB2 and SMB3 support, an elementary OS desktop can act as a small file server while Windows 10 or 11 computers connect through File Explorer or a mapped network drive.

This guide sets up a standalone Samba server for a home or small-office network. It covers user accounts, folder permissions, Windows authentication, firewall access and maintenance while keeping guest access and obsolete SMB1 disabled. The arrangement suits mixed-device households, school workspaces and small Australian businesses that need shared documents without installing a full NAS operating system.

Planning a Practical Shared Folder

Choose the computer that will host the share. The elementary OS machine should be powered on reliably, connected by Ethernet or stable Wi-Fi, and reachable on the same local network as the Windows PCs. Windows acts as the client in this arrangement; it does not need to join an Active Directory domain, and the shared computer does not need to be exposed to the internet.

Australian homes and small offices in Sydney, Melbourne, Brisbane and other cities commonly use a mixture of devices. A Windows 11 laptop from Dell, HP or Lenovo may sit beside an Android phone or tablet, while staff and family members exchange documents through different applications. On an NBN connection, those devices usually reach the same household router and can share files over its local network. SMB traffic does not need to pass through the wider internet, so opening router ports is unnecessary and risky.

Plan the shared folder before changing Samba. Give it a clear purpose, such as Team, Scans or Client-Documents, and keep it separate from personal files. Avoid names that differ only by capitalisation, since Windows treats them as the same while a Linux filesystem may treat them differently. Reserve a fixed local IP address for the elementary OS machine in the router’s DHCP settings, making the server easier to reach after its address changes.

Installing Samba and Preparing Accounts

Open Terminal from the applications menu and install Samba together with its command-line utilities:

sudo apt update
sudo apt install samba samba-common-bin
sudo systemctl enable --now smbd

The samba-common-bin package provides tools such as smbclient, which can test a share locally. Enabling smbd ensures the file-sharing service starts with the computer.

Create a dedicated Linux account and a group for share users. The account can be barred from normal desktop login while still being available to Samba:

sudo adduser --disabled-login --gecos "" shareuser
sudo groupadd sambausers
sudo usermod -aG sambausers shareuser
sudo smbpasswd -a shareuser
sudo smbpasswd -e shareuser

The password entered with smbpasswd is the Windows share password; it does not have to match a Linux login password. Use a long, unique password. Give each additional person their own Linux and Samba account rather than sharing shareuser, especially where access records or different folder permissions matter.

Create the directory and assign it to the group:

sudo mkdir -p /srv/samba/team
sudo chown shareuser:sambausers /srv/samba/team
sudo chmod 2770 /srv/samba/team

The setgid bit in 2770 makes new items inherit the sambausers group. The Samba configuration in the next section enforces the same group on newly created files, keeping access consistent.

Configuring a Windows-Compatible Share

Open /etc/samba/smb.conf with sudo nano /etc/samba/smb.conf. Within the existing [global] section, add or confirm these settings:

workgroup = WORKGROUP
server role = standalone server
server min protocol = SMB2_02
server max protocol = SMB3
map to guest = never

Modern Windows releases negotiate SMB2 or SMB3 with this configuration. Do not lower the minimum protocol to NT1, commonly called SMB1, merely to support an obsolete device. Replace that device or use a current client instead, as SMB1 lacks modern security protections.

Add a share definition at the end of the file:

[Team]
    path = /srv/samba/team
    browseable = yes
    read only = no
    guest ok = no
    valid users = @sambausers
    force group = sambausers
    create mask = 0660
    directory mask = 0770
    inherit permissions = yes
    case insensitive = yes
    smb encrypt = desired

The valid users directive limits access to members of sambausers. The masks grant read and write access to the owner and group while denying it to everyone else. smb encrypt = desired requests encryption when the connecting client supports it. The case-insensitive setting provides familiar Windows behaviour, although filenames that differ only by letter case should still be avoided.

Check the complete configuration before restarting the service:

sudo testparm -s
sudo systemctl restart smbd

Correct any reported syntax or permission errors before testing from Windows. If the Uncomplicated Firewall is active, allow TCP port 445 only from the trusted local subnet:

sudo ufw allow from 192.168.1.0/24 to any port 445 proto tcp

Replace that example subnet with the actual network used by the office or home. Direct access by IP does not require the older network discovery ports.

Connecting from Windows and Diagnosing Faults

On the Windows computer, open File Explorer and enter the server path in the address bar. Use the elementary OS hostname followed by the share name, such as \\elementary-share\Team. If the name does not resolve, obtain the server’s address with hostname -I on elementary OS and connect to \\192.168.1.50\Team, replacing the example with the actual address.

Windows should request the share credentials. Enter shareuser with its Samba password, or try WORKGROUP\shareuser if the plain username is rejected. To make the folder convenient, use Map network drive in File Explorer, select a drive letter and enter the UNC path. Credentials can be stored in Windows Credential Manager under Windows Credentials, rather than embedded in documents or scripts.

Network discovery is less reliable than direct access because some Australian home routers filter broadcast traffic. It is also normal for the share to be absent from Windows’ Network view while its UNC path works perfectly. Set the trusted Ethernet or Wi-Fi network to a private profile in Windows, but leave Windows Firewall enabled. Android phones are also common in Australian homes and small offices; Android device guidance can help with keeping the handset side current, while an SMB-capable file manager is still needed to reach the share.

Run these checks on the elementary OS host:

systemctl status smbd --no-pager
sudo testparm -s
smbclient //localhost/Team -U shareuser
sudo ss -ltnp | grep ':445'
sudo ufw status

The smbclient command prompts for the Samba password and confirms that the service, account and share work locally. A listening port and successful local test point towards a Windows firewall, subnet rule or hostname problem. An authentication error means Windows has reached Samba but the supplied credentials or account permissions are wrong. Review recent service messages with sudo journalctl -u smbd -n 50 --no-pager when startup or connection errors are not obvious.

Protecting Data and Maintaining the Share

Treat the Samba service like any other network-accessible system. Use individual accounts, disable unused accounts with sudo smbpasswd -x username, and require strong passwords. Keep the share restricted to a trusted LAN, and use a VPN when remote access is genuinely necessary. Never forward router port 445 to the internet. For particularly sensitive material, smb encrypt = required can enforce encryption, although every client must support it and some older Android or third-party applications may fail.

The federal Privacy Act 1988 and Australian Privacy Principles apply to many covered organisations and businesses. Depending on the jurisdiction and activity, state and territory laws such as NSW’s Privacy and Personal Information Protection Act 1998 or Victoria’s Privacy and Data Protection Act 2014 may also be relevant. A shared folder containing staff records, client details, invoices or Australian Taxation Office material can therefore fall within privacy obligations. User permissions, audit records, retention rules and incident procedures matter alongside the Samba configuration.

A file share is not a backup. Keep at least two additional copies on separate media or services, such as an encrypted external drive and a managed backup system, and occasionally restore a sample file to confirm it can be recovered. Take care when copying a folder while people are editing it so the backup contains a consistent version. A cloud service may also require consideration of data location and overseas disclosure rules, particularly when files contain personal information.

For source code, version control is usually more suitable than a general-purpose shared folder. The companion guide to hosting a Git repository on elementary OS explains that workflow. Keep Samba updated, monitor disk space and service logs, retest accounts after configuration changes, and remove obsolete permissions as team membership changes.


A reliable Samba setup keeps the shared data isolated, uses named accounts instead of guest access, negotiates SMB2 or newer and limits TCP port 445 to the trusted local network. Windows users then gain a familiar network drive while the elementary OS host remains under your control.

The practical takeaway is to begin with one private folder, one least-privilege account per person and a tested backup, giving Windows compatibility without turning the elementary OS computer into an exposed internet service.

Browse the News Archive
Latest Updates

From the elementary weekly series

Low-poly faceted abstract render in dark charcoal and electric blue tones, suggesting a news bulletin or announcement
elementary news

elementary weekly #20

The first week with the final Freya release — community reactions, tips, and early impressions gathered in one roundup.

Abstract low-poly geometric scene in midnight blue and soft cyan, conveying a live broadcast or event atmosphere
elementary news

elementary SPECIAL

A live Hangouts event with the elementary OS founders, held on 11 April 2015, discussing the Freya final release.

Low-poly faceted render in deep navy and muted teal with subtle amber highlights, suggesting a tutorial or guide
Tips and Tricks

Timeshift Guide

How to use Timeshift — the intuitive system restore utility for elementary OS — to recover from configuration mishaps.

Explore

Topics & Resources

Dive into guides, application recommendations, and community discussions covering every aspect of elementary OS.