Create Home NAS 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 AttuneOps

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

Name Type Script Reference Default Value Comment
Linux Node Linux / Unix Server linuxNode
Linux User Linux OS Credential linuxUser

1 - Update yum repositories

Updates yum repositories.

The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
sudo yum -y update

2 - Install Samba Server

Installs and configures samba server.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# 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 on node

Connect via SSH
ssh user@hostname
Deploy archive password.txt.zip to remote path uploads
  1. Locate Files archive "password.txt.zip", This can be downloaded from Attune
  2. Copy the Files archive to the server
  3. Extract the root of the Files archive to uploads, relative to the home directory
  4. Check that the files are in the correct location

4 - Configure Samba Server

Sets password for Samba Server.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
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 on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# Restart samba server
sudo systemctl restart smb.service