Установка samba oracle linux

To Install and Configure the Samba Server on Oracle Linux

Samba is a free and open-source software that allows files to be shared across Windows and Linux system.Samba provides file and print services for various Microsoft Windows clients .Samba is released under the terms of the GNU General Public License.The SMB is a protocol that is used for sharing access to files, printers.

Installation steps:

Step 1: check the OS version by using the below command

[[email protected] ~]# cat /etc/os-release NAME="Oracle Linux Server" VERSION="8.4" ID="ol" ID_LIKE="fedora" VARIANT="Server" VARIANT_ID="server" VERSION_ID="8.4" 

Step 2: Install the samba packages by using the below command

[[email protected] ~]# yum install samba* Last metadata expiration check: 1 day, 0:19:12 ago on Friday 26 November 2021 09:35:06 AM IST. Package samba-client-libs-4.13.3-3.el8.x86_64 is already installed. Package samba-common-4.13.3-3.el8.noarch is already installed. Package samba-common-libs-4.13.3-3.el8.x86_64 is already installed. Dependencies resolved. ============================================================================================================================================ Package Architecture Version Repository Size ============================================================================================================================================ Installing: samba x86_64 4.14.5-2.el8 ol8_baseos_latest 847 k samba-client x86_64 4.14.5-2.el8 ol8_baseos_latest 700 k samba-common-tools x86_64 4.14.5-2.el8 ol8_baseos_latest 499 k samba-krb5-printing x86_64 4.14.5-2.el8 ol8_baseos_latest 98 k samba-libs x86_64 4.14.5-2.el8 ol8_baseos_latest 169 k samba-pidl noarch 4.14.5-2.el8 ol8_baseos_latest 196 k samba-test x86_64 4.14.5-2.el8 ol8_baseos_latest python3-ldb x86_64 2.2.0-2.el8 ol8_baseos_latest 64 k python3-samba x86_64 4.14.5-2.el8 ol8_baseos_latest 3.2 M /sbin/ldconfig: /etc/ld.so.conf.d/kernel-5.4.17-2102.201.3.el8uek.x86_64.conf:6: hwcap directive ignored Complete! 

Step 3: Start the samba service by using the below command

Step 4: Enable the samba service by using the below command

[[email protected] ~]# systemctl enable smb Created symlink /etc/systemd/system/multi-user.target.wants/smb.service → /usr/lib/systemd/system/smb.service. 

Step 5: Check the status of samba service by using the below command

[[email protected] ~]# systemctl status smb ● smb.service - Samba SMB Daemon Loaded: loaded (/usr/lib/systemd/system/smb.service; enabled; vendor preset: disabled) Active: active (running) since Sat 2021-11-27 09:55:20 IST; 26s ago Docs: man:smbd(8) man:samba(7) man:smb.conf(5) Main PID: 10590 (smbd) Status: "smbd: ready to serve connections. " Tasks: 4 (limit: 10509) Memory: 41.2M CGroup: /system.slice/smb.service ├─10590 /usr/sbin/smbd --foreground --no-process-group ├─10592 /usr/sbin/smbd --foreground --no-process-group ├─10593 /usr/sbin/smbd --foreground --no-process-group 

Step 6: Edit the configuration file by using the below command

[[email protected] ~]# vim /etc/samba/smb.conf [samba] path=/sambashare comment=samba browseable=yes writable=yes guest ok=yes read only=no 

Step 7: create a directory for sharing by using the below command

Читайте также:  Как ставить linux сервер

Step 8: change the permission of shared folder by using the below command

Step 9: create files in shared folder by using the below command

Step 10: check the configuration file by using the below command

[[email protected] ~]# testparm Load smb config files from /etc/samba/smb.conf Loaded services file OK. Weak crypto is allowed Server role: ROLE_STANDALONE Press enter to see a dump of your service definitions #Global parameters [global] printcap name = cups security = USER workgroup = SAMBA idmap config * : backend = tdb cups options = raw [homes] browseable = No comment = Home Directories inherit acls = Yes read only = No valid users = %S %D%w%S [printers] browseable = No comment = All Printers create mask = 0600 path = /var/tmp printable = Yes [print$] comment = Printer Drivers create mask = 0664 directory mask = 0775 force group = @printadmin path = /var/lib/samba/drivers write list = @printadmin root [samba] comment = samba guest ok = Yes path = /sambashare read only = No 

Step 11: Adding a new user by using the below command

Step 12: Set the password to sambauser by using the below command

[[email protected] ~]# passwd sambauser Changing password for user sambauser. New password: BAD PASSWORD: The password is shorter than 8 characters Retype new password: passwd: all authentication tokens updated successfully. 

Step 13 : Change the user to samba user by using the below command

[[email protected] ~]# smbpasswd -a sambauser New SMB password: Retype new SMB password: Added user sambauser. 

Step 14: Restart the samba service by using the below command

Step 15: Avoid a home directory comment by using the below command

[[email protected] ~]# vim /etc/samba/smb.conf #[homes] # browseable = No # comment = Home Directories # inherit acls = Yes # read only = No # valid users = %S %D%w%S 

Conclusion:

We have reached the end of this article. In this guide, we have walked you through the steps required to install and configure the Samba server on Oracle Linux. Your feedback is much welcome.

Читайте также:  Extending primary partition linux

Источник

How to Build a File Server on Oracle 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:

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 

Create a Shared Directory in Linux Server

Create a new directory to share with others:

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.

Читайте также:  List acl in linux

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:

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

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

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.

Источник

Оцените статью
Adblock
detector