This will guide you through purchasing a hetzner StorageBox and mounting it on either a dedicated server or a cloud instance. This guide focuses on mounting on Ubuntu or Debian based OS’s.
Hetzner StorageBox setup
- Login to Hetzner robot and order a storage box if you do not already have one.
- Configure the storage box to enable Samba
- Note down the SAMBA/CIFS path
- Also note down the username and reset password to retrieve it (if you do not already know it)
Install needed tools in Ubuntu
- sudo apt update -y
- sudo apt install cifs-utils
Create credentials file and secure it
- nano /root/.smbcredentials
username=YOUR_USERNAME password=YOUR_PASSWORD
- chmod 600 /root/.smbcredentials
Setup mount and enable on boot
Here we will setup the mount, this will force SMB v3, NTLMv2 auth and enable encryption (seal) to make it more secure.
Change the path to what you need
- mkdir -p /mnt/storagebox
- nano /etc/fstab
Add the following – be sure to change username
# StorageBox //<USERNAME>.your-storagebox.de/backup /mnt/storagebox cifs credentials=/root/.smbcredentials,uid=1000,gid=1000,file_mode=0660,dir_mode=0770,vers=3.0,seal,sec=ntlmssp,noserverino 0 0
Let’s mount it now and make sure it works
- mount -a
- df -h
You should now see your storage box with the correct size in the list.
Troubleshooting
- Make sure you have opened ports 139 and 445 in your firewall
- Make sure username/password and host are correct
- You can try and lower the SMB version to 2.1 – but 3.0 should be supported by hetzner
- Check logs for errors