Create Home NAS Server – CentOS/Fedora/Red Hat

Exported on 26-Aug-2021 11:54:34

Installs a NAS server in the target machine

Parameters

Name Type Script Reference Default Value Comment
s1 Linux / Unix Server s1
s1c Linux OS Credential s1c

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

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

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