This guide covers how to create and publish SMB (Samba) network shares from Manjaro Linux so that other devices on your local network can access them.
It includes package installation, Samba service setup, share configuration, user authentication, and a simple way to test the share from another machine.
Install the Samba server package from Manjaro’s repositories:
sudo pacman -S samba
If you want command-line client tools for testing shares from the Manjaro machine itself, also install the Samba client utilities:
sudo pacman -S smbclient
Choose or create a directory to share. For example:
sudo mkdir -p /srv/samba/share
sudo chown -R root:users /srv/samba/share
sudo chmod -R 2775 /srv/samba/share
If you want a specific user to own the files instead of the users group, adjust the owner and group to match your local setup.
Samba uses its own password database. Add the Linux user to Samba with:
sudo smbpasswd -a yourusername
Then enable that account:
sudo smbpasswd -e yourusername
Edit the Samba configuration file:
sudo nano /etc/samba/smb.conf
Add a share definition like this near the end of the file:
[SharedFolder]
path = /srv/samba/share
browseable = yes
read only = no
guest ok = no
valid users = yourusername
create mask = 0664
directory mask = 2775
If you want guest access on a trusted local network, you can use a separate share definition like this:
[GuestShare]
path = /srv/samba/share
browseable = yes
read only = no
guest ok = yes
force user = nobody
Guest access is less secure, so use it only when you really want unauthenticated network access.
Check the Samba configuration for syntax errors:
testparm
If testparm reports no errors, the configuration is ready to use.
Enable the Samba services so they start automatically at boot:
sudo systemctl enable --now smb nmb
If you only need modern SMB file sharing and not legacy NetBIOS browsing, smb is usually the most important service.
If you use a firewall on Manjaro, allow SMB traffic on the local network.
For ufw:
sudo ufw allow samba
For firewalld:
sudo firewall-cmd --permanent --add-service=samba
sudo firewall-cmd --reload
If you do not use a firewall, you can skip this step.
From another computer, connect to the share using the Manjaro machine’s IP address or hostname.
Example from Linux:
smbclient //manjaro-hostname/SharedFolder -U yourusername
Example from Windows:
\\manjaro-hostname\SharedFolder
Enter the Samba username and password when prompted.
If you want the Manjaro machine to act as a Git host, create a dedicated folder for bare repositories on the server itself. Other computers should access those repositories with git clone, usually over SSH.
Bare repositories do not contain a working copy. They are meant to be the central server-side copy that clients clone from and push to.
sudo mkdir -p /srv/git
sudo chown -R yourusername:users /srv/git
sudo chmod -R 2775 /srv/git
If you want the repository folder to be owned by a service account instead of your personal account, use that user and group consistently for all repo operations.
If you want to mirror an existing GitHub repository into the server folder, use a bare clone:
git clone --bare https://github.com/owner/example-project.git /srv/git/example-project.git
You can repeat this for each project you want to host on the server.
If the server copy should stay in sync with GitHub, run git fetch inside each bare repository. A bare clone from GitHub already has a remote named origin, so it can be updated with:
cd /srv/git/example-project.git
git fetch origin --prune --tags
If you created the repository first and added GitHub later, add the remote once:
cd /srv/git/example-project.git
git remote add github https://github.com/owner/example-project.git
git fetch github --prune --tags
To update every bare repository on a schedule, use a small script such as:
#!/bin/bash
for repo in /srv/git/*.git; do
[ -d "$repo" ] || continue
git -C "$repo" fetch origin --prune --tags
done
Save it as something like /usr/local/bin/update-git-mirrors.sh, make it executable, and run it from cron or a systemd timer if you want the fetch to happen automatically.
Install and start the SSH server so other machines can reach the repository folder:
sudo pacman -S openssh
sudo systemctl enable --now sshd
If you use a firewall, allow SSH traffic on the local network:
sudo ufw allow ssh
or:
sudo firewall-cmd --permanent --add-service=ssh
sudo firewall-cmd --reload
From another Linux machine, clone the repository with an SSH path:
git clone yourusername@manjaro-hostname:/srv/git/example-project.git
If SSH key authentication is set up, the clone can proceed without prompting for a password.
After cloning, work in your local repository and push changes back to the server with normal Git commands.
smb is running with systemctl status smb.testparm.smbpasswd -a.valid users matches the account you are using.guest ok = yes is present in the share definition.git init --bare.git clone --bare, verify the remote URL and repository path before pushing from clients.Avoid using guest shares unless you trust everyone on the network.
For better control, prefer authenticated shares with per-user access and tighter filesystem permissions.
If you expose Samba beyond a private LAN, also consider encrypting traffic, limiting allowed hosts, and using a stronger firewall policy.