• WordPress
  • cPanel
  • Softaculous
  • KVM Virtualization
  • Vmware Virtualization
  • Proxmox
Friday, May 23, 2025
LinuxBoost
  • Home
  • Almalinux
  • CentOS
  • Debian
  • Fedora
  • Ubuntu
  • Red Hat Enterprise Linux
  • Rocky Linux
  • OpenSUSE
  • Arch Linux
  • Oracle Linux
No Result
View All Result
LinuxBoost
  • Home
  • Almalinux
  • CentOS
  • Debian
  • Fedora
  • Ubuntu
  • Red Hat Enterprise Linux
  • Rocky Linux
  • OpenSUSE
  • Arch Linux
  • Oracle Linux
LinuxBoost
  • Home
  • Almalinux
  • CentOS
  • Debian
  • Fedora
  • Ubuntu
  • Red Hat Enterprise Linux
  • Rocky Linux
  • OpenSUSE
  • Arch Linux
  • Oracle Linux

How to Build a File Server on Oracle Linux

in Linux OS, Oracle Linux, Red Hat Enterprise Linux
How to Build a File Server on Oracle Linux

A file server is a crucial component in today’s data-driven world, allowing users to store, share, and access files within a network. Oracle Linux is a popular choice for file servers due to its robustness, security, and scalability. In this article, we will walk you through the process of how to build a file server on Oracle Linux.

Prerequisites

Before we begin, ensure that you have the following:

  1. An Oracle Linux system 7 or 8 installed and updated.
  2. A Root user account or with sudo privileges.
  3. A basic understanding of how to disable root login, enable 2FA, and use SSH keys for secure remote access.

How to Build a File Server on Oracle Linux

Install the Required Packages

We will use the Samba suite to set up our file server. Install the necessary packages by running the following command:

sudo yum install -y samba samba-client samba-common

Configure Samba on Oracle Linux

Next, create a backup of the original Samba configuration file:

sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak

Open the Samba configuration file using a text editor like Vim:

sudo vim /etc/samba/smb.conf

Edit the file by adding the following lines:

[global]
   workgroup = WORKGROUP
   server string = Samba Server %v
   netbios name = oraclelinux
   security = user
   map to guest = bad user
   dns proxy = no

Create a new share by adding the following lines at the end of the file. Replace /path/to/share with the actual path of the directory you want to share.

[MyShare]
   path = /path/to/share
   browsable =yes
   writable = yes
   guest ok = yes
   read only = no

Save and exit the file.

Create a Shared Directory in Linux Server

Create a new directory to share with others:

sudo mkdir -p /path/to/share

Set the appropriate permissions for the shared directory:

sudo chown -R nobody:nobody /path/to/share
sudo chmod -R 0755 /path/to/share

Add Samba User and Set Password

Add a new Samba user and set a password for the user:

sudo smbpasswd -a username

Replace username with your desired username. You will be prompted to enter a password for the user.

Start and Enable Samba Services

Start the Samba services and enable them to run at startup:

sudo systemctl start smb.service
sudo systemctl start nmb.service
sudo systemctl enable smb.service
sudo systemctl enable nmb.service

Configure Firewall

To allow Samba traffic through the firewall, run the following commands:

sudo firewall-cmd --add-service=samba --permanent
sudo firewall-cmd --reload

Test the File Server

To test the file server, run the following command:

smbclient -L localhost -U%

You should see the shared directory listed under “Sharename.”

From a Windows client, open File Explorer and enter the following in the address bar:

\\oraclelinux\MyShare

Replace oraclelinux with the hostname or IP address of your Oracle Linux server, and MyShare with the name of the share you created in the smb.conf file.

From a Linux client, you can mount the shared directory with the following command:

sudo mount -t cifs //oraclelinux/MyShare /mnt -o username=username,password=password

Replace oraclelinux with the hostname or IP address of your Oracle Linux server, MyShare with the name of the share you created in the smb.conf file, and username and password with the appropriate Samba username and password.

Secure the File Server

To enhance the security of your file server, consider the following best practices:

  1. Install Fail2Ban to protect your server from brute-force attacks.
  2. Configure a firewall to limit incoming and outgoing traffic.
  3. Enable SSL/TLS encryption for secure communication between the server and clients.
  4. Regularly update your server with security patches.

Conclusion

You have successfully set up a file server on Oracle Linux using Samba. Your users can now store, share, and access files within the network. As your needs grow, you can easily add additional storage using RAID configurations or even set up an OpenVPN server for remote access to your file server.

Remember to follow security best practices to protect your server and data from potential threats.

ShareTweet
Previous Post

How to Disable Root Login on Oracle Linux

Next Post

How to Install FTP Server on Oracle Linux

Related Posts

How to Install Flask on Rocky Linux

How to Install Flask on Rocky Linux

How to Install Tomcat on Rocky Linux

How to Install Apache Tomcat on Rocky Linux

How to Set up NTP Server on Rocky Linux

How to Set up NTP Server on Rocky Linux

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Golden Host VPS
  • Privacy Policy
  • Terms and Conditions
  • About Us
  • Contact Us

Copyright © 2023 linuxboost.com All Rights Reserved.

  • Privacy Policy
  • Terms and Conditions
  • About Us
  • Contact Us

Copyright © 2023 linuxboost.com All Rights Reserved.