Create Home NAS Server(Samba Server) – CentOS/Fedora/Red Hat

Exported on 22-Sep-2021 14:27:23

Install Home NAS Server (Samba Server) On RHEL Based Linux System With Attune Automation

This Blueprint Installs Samba Server On A RHEL Based Linux System

Samba is a suite of Unix applications that speak the Server Message Block (SMB) protocol. It works like this: The clients send their NetBIOS names & IP addresses to the NBNS server, which keeps the information in a simple database. When a client wants to talk to another client, it sends the other client's name to the NBNS server.

Pre-Blueprint Attune setup
  1. On the Inputs tab, create a Linux node for the host you wish to install the stack on.

  2. On the Inputs tab, create Linux credentials to connect to the host you wish to install the stack on.

Steps Involved
  • Update Yum Repositories.

  • Install Samba Server.

  • Protect the Samba server with a password and launch it.

Parameters

1 - Update yum repositories

Updates yum repositories.

The connection details have changed from the last step.

Login as user {Linux User} on node {Linux Node}

sudo yum -y update

2 - Install Samba Server

Installs and configures samba server.

Login as user {Linux User} on node {Linux Node}

# Install and setup a samba server
sudo yum -y install samba

# Start the samba server
sudo systemctl start smb.service

# Autostart the samba server on reboot
sudo systemctl enable smb.service

3 - Upload password file for samba server

Uploads a password file.

Login as user {Linux User} on node {Linux Node}

Deploy archive password.txt.zip to remote path uploads

4 - Configure Samba Server

Sets password for Samba Server.

Login as user {Linux User} on node {Linux Node}

mkdir ~/sambashare/

export LOCAL_USER_NAME=$(whoami)

sudo echo "[sambashare]
    comment = Samba on Ubuntu
    path = /home/"$LOCAL_USER_NAME"/sambashare
    read only = no
    browsable = yes" >> sudo tee -a /etc/samba/smb.conf

#Set password 
cat uploads/password.txt | sudo smbpasswd -a $LOCAL_USER_NAME

5 - Restart Samba Server

Restart Samba Server.

Login as user {Linux User} on node {Linux Node}

# Restart samba server
sudo systemctl restart smb.service