Publish Date: 15 Feb 2026 Last update: 15 Feb 2026
Introduction
What storage can you use?
Setting up SMB in Fedora
Installing Samba
Creating user account for SMB
Sharing File Path
Edit samba conf. file
Testing the SMB connection for the drive
Other notes
Drive Ownership & Permission Issues
Client computer can’t see any file in the folder
Deleting the wrong share file path
Conclusion
Note: Please use ctrl + F to go to the topic you are interested
Tired of managing data across devices. Tired of expensive cloud subscription. Why not have your own personal file server? You can start the external drive or any storage you have on hand and slowing expend with a DAS (Direct Attach Storage). In this session, I am going to show you how to set up SMB file sharing in Fedora.
You can use whatever you want as long as your OS can read it. However, I would recommend high capacity hard disk. As most of the data isn’t going to be accessed daily anyway, and we all have great stories to tell about the data that we are going to store )_<. I am currently using an external 5 TB HDD from WD, but will get a 2 DAS later.
Here is the setup process for SMB in Fedora. I am also going to put some issues that I have encountered during the setup of SMB, in case you type in the wrong file path. In best practice, please double-check your command before pressing Enter.
1. Installing Samba
Step 1: Install Samba
sudo dnf install samba
Note 1: Everytime you use "sudo" you will be asked for admin password
Note 2: Samba is likely come pre-installed with fedora
Step 2: Enable Auto-Start for Samba after bootup
sudo systemctl enable smb --now
Step 3: Making sure Samba isn’t blocked by the firewall
firewall-cmd --get-active-zones
sudo firewall-cmd --permanent
--zone=FedoraWorkstation --add-service=samba
sudo firewall-cmd --reload
2. Creating user account for SMB
The user account for SMB is separated from the OS, so you need to create an account specifically for SMB unless you want a guest user (meaning no need for a password).
Step 1: Create a new smb user account
sudo smbpasswd -a [smb user_name]
Note: Replace [smb user_name] with anything you like e.g. John_Wick
Step 2: Set the password for the new smb user account
#Expected outcome after step 1
New SMB password:
Retype new SMB password:
Added user John_Wick.
3. Sharing File Path
Step 1: Label the file path for sharing with Samba
sudo semanage fcontext --add --type “samba_share_t” “[file_path](/.*)?
Example [file_path]: /run/media/john_wick/Samsung_SSD(/.*)?
Step 2: Restore the correct security context labels for the shared file path
sudo restorecon -R [file_path]
Note 1: Replace [file_path] that you typed in Step 1
Note 2: no need to type in (/.*)
4. Edit samba conf. file
Step 1: Open the Samba conf. file with nano in terminal
sudo nano /etc/samba/smb.conf
Step 2: Add necessary information to the smb.conf file
[File_path_name]
Comment = [As_note]
Path = [file path in 3.1 without (/.*)]
Writeable = yes (*this is allowing write permission)
Browseable = yes (*read permission)
Public = yes (optional)
Create mask = 0644
Directory mask = 0755
Write list = [smb user name] (*user account that allow to access drive)
Note: If you want to allow drive to be accessed without account, add a line "guest ok = yes"
Step 3 (optional): Time machine backup for Mac -> add the line below to smb.conf
min protocol = SMB2
ea support = yes
vfs objects = catia fruit streams_xattr
fruit:metadata = stream
fruit:model = MacSamba
fruit:posix_rename = yes
fruit:veto_appledouble = no
fruit:nfs_aces = no
fruit:wipe_intentionally_left_blank_rfork = yes
fruit:delete_empty_adfiles = yes
fruit:time machine = yes
Step 4: Save the changes by “ctrl + x” -> “y” -> “enter”
5. Testing the SMB connection for the drive
Since the process is similar across Windows, Macos and Linux, the following session will only demonstrate how to connect to a file server/drive in macOS.
Step 1: Go to finder “Go” -> “connect to server”
Step 3: Login in with the SMB user account
Note: If you have put in “guest ok = yes” in smb.conf, then pick Guest
Step 4: Enjoy
6.1 Drive Ownership & Permission Issues
Sometimes when you format a drive in Fedora, the drive owner might be owned by “root” but you. They might prevent you from writing to the drive that is shared by Samba. Below is how.
Step 1: Changing the drive owner
sudo chown -R user:user [file_path]
Note: Replace the “user:user” with your user name in the OS
Step 2: Change the read, write, and execute permissions for the file path
sudo chmod -R 0700 [file_path]
6.2 Client computer can’t see any file in the folder
This is likely due to permission issues in Linux. Below is a command that you can give it a try for non-home directory file sharing.
Step 1: Type in the command below command
sudo setsebool -P samba_export_all_rw on
6.3 Deleting the wrong share file path
In case of any typo that has been made in the shared file path. It can find and delete with the following command.
Step 1: Search the shared Samba file path
sudo semanage fcontext -l | grep “samba_share_t"
Step 2: Delete the shared Samba file path that you want
sudo semanage fcontext -d “[wrong file path]”
Hope you find it easy to follow and have fun managing all your “homework” files.