Create Home NAS Server – Ubuntu/Debian

Exported on 26-Aug-2021 12:00:27

Parameters

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

1 - Update APT Repositories

Update APT 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
# Update apt repositories
sudo apt update

2 - Install Samba Server

Install 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 Samba
sudo apt -y install samba

3 - Upload password file

Upload password file, contains password to be set for the Samba client.

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

Configure samba share server for the current user

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

Restarts Samba Server.

Once this is complete you can use a File manager to connect to the Samba file server with the endpoint: smb://your_ip/sambashare

Reference: https://ubuntu.com/tutorials/install-and-configure-samba#4-setting-up-user-accounts-and-connecting-to-share

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 service smbd restart