How to Install Samba on Fedora Server Latest

Samba is an open-source software that enables file and print sharing between Linux/UNIX servers and Windows clients. In this tutorial, we will explain how to install Samba on Fedora Server Latest.

Prerequisites

Before we start, we assume you already have:

  • A running Fedora Server Latest
  • An administrative user account to access the command line

Step 1: Update the System

Before installing any software, it is a good practice to update the system packages to the latest version.

To update the system, run the following command:

sudo dnf update

Step 2: Install Samba

To install Samba, run the following command:

sudo dnf install samba samba-client

This command installs the Samba server and client, which are needed for sharing files between the server and other computers on a network.

Step 3: Configure Samba

After installing Samba, you need to configure it to share files on your network.

The configuration file for Samba is located at /etc/samba/smb.conf. You can edit the file using any text editor of your choice.

For example, to edit the file using the nano editor, run the following command:

sudo nano /etc/samba/smb.conf

Example Configuration

Here is a sample configuration that enables file sharing for the users group and allows guest access to the shared directory:

[global]
workgroup = WORKGROUP
security = user

[shared]
comment = Shared Directory
path = /srv/samba/share
read only = No
guest ok = Yes

Save and exit the file by pressing Ctrl + X, then Y, and then Enter.

Explanation

  • The global section contains global settings for the Samba server. The workgroup parameter specifies the workgroup name for the network, and the security parameter specifies the security mode for the server.
  • The shared section defines the shared directory. The comment parameter describes the shared directory, and the path parameter specifies the path to the shared directory. The read only parameter specifies whether users can write to the shared directory. The guest ok parameter allows guest access to the shared directory.

Step 4: Create a Shared Directory

Next, you need to create a directory that you want to share over the network.

In this example, we will create a directory named share inside the /srv/samba directory:

sudo mkdir -p /srv/samba/share

And then set the permissions to allow everyone to read and write to the folder:

sudo chmod -R 0755 /srv/samba/share
sudo chown -R nobody:nobody /srv/samba/share

Step 5: Start and Enable Samba

Finally, you need to start and enable the Samba service so that it starts automatically on system boot.

To start the service, run the following command:

sudo systemctl start smb.service

And then enable it to start automatically on boot:

sudo systemctl enable smb.service

Conclusion

Congratulations! You have successfully installed and configured Samba on Fedora Server Latest. Now, you can easily share files between your server and other computers on a network.