This post goes through the process of setting up a Windows Samba share on Fedora 26. This will let me access folders on the Fedora machine using windows explorer.
Installing the necessary programs
To set up samba on Fedora we need to install some programs first. These are samba and samba-client. For good measure once these have been installed we will reboot the machine. This can be done as follows.
sudo dnf install samba samba-client sudo reboot
Once the machine has rebooted we are ready to configure samba
Configuring Samba to share folders
The configuration file for Samba is located at /etc/samba/smb.conf. One of the changes I am going to make is to change the workgroup. Here I am going to change it to the workgroup used at home, “BUNKER”.
I am going to add one new share with the below template.
[WD1TB] comment = Public folder path = /home/public valid users = @samba force group = samba create mask = 0660 directory mask = 0771 read only = no
Here I name the folder “Public folder” and add the path to the folder /home/public/
I set the users that are allowed to access the share to @samba. This means that all users who have the samba group are allowed to access this share. By forcing the group to samba all users accessing the folders will be doing so as the samba user. This can resolve a number of permission issues.
The create mask and directory mask are set up so that any files or directories are created with the given mask.
Finally setting read only can allow you to make read only shares. For this case I want to be able to write to the folder.
Now samba has been configured I need to ensure it always runs when the machine turns on. I can do this with the following two commands.
The first enables samba so that it will start on every system boot. The second starts it for this session.
In addition to starting samba we need to add a service rule to allow samba through the default Fedora firewall. The following two commands add samba as a permitted service and reloads the rules to allow it through.