Installing and Configuring Samba
-
2. Installing Samba on Fedora 42
Run the following Command to Install Samba Server and Utilities:
sudo dnf install samba*
This will install the core packages for enabling SMB/CIFS File Sharing on Fedora.
Need
sudo
access? Check: Fix Sudo Permissions -
3. Configuring the Samba Share
Open the main Samba configuration file:
sudo nano /etc/samba/smb.conf
For quick, anonymous (read-only) access, use:
[sharing] comment = Public Share path = /home/[myUser]/Public browseable = yes read only = yes guest ok = yes
Replace
[myUser]
with your actual username (runwhoami
to confirm).For password-protected access:
[sharing] comment = Secure Share path = /home/[myUser]/Public browseable = yes security = user encrypt passwords = yes
To make the share writable:
writable = yes
Optionally restrict access to your private network:
hosts allow = 127.0.0.1 192.168.1.0/24
Add your user to Samba:
sudo smbpasswd -a `whoami`
-
4. Fedora Firewall & SELinux Setup for Samba
Allow Samba through Fedora 42 Firewall and configure SELinux:
sudo setsebool -P samba_export_all_rw on
sudo firewall-cmd --add-service=samba --permanent
sudo firewall-cmd --reload
-
5. Starting Samba Services
Enable and start the Samba daemons:
sudo systemctl enable smb nmb
sudo systemctl start smb nmb
This activates Samba file and network discovery services on Fedora.
-
6. Finding your Fedora IP Address
Use this command to find your system’s IP address:
ip a
Look for the
inet
entry under your main interface (usuallyeth0
orwlan0
).
Contents