Search This Blog

Saturday, February 8, 2020

Synology Follow-Up

In the previous post ( I configured the Synology DS218j through a virtual network using an Ubuntu VM as the DHCP Server.  Today I wanted to back up some of my files, so I needed to configure some kind of share.

Enable SSHd on the VM

  1. $ sudo apt-get install -y openssh-server
  2. $ sudo systemctl enable ssh.service
  3. $ sudo systemctl start ssh.service

Create an Account on Synology

You will need an account to connect to on the Synology.  You could use the admin account, but don't.  This was easy enough and walking through the Wizard after clicking "Users" somewhere in Control Panel, I created an account named 'charlie'.  
The Control Panel is easy to find when you log in with the Web Browser on port 5000 over HTTP
HTTP is Plain-Text and thus Not Secure.  This is another good reason we are working on a private virtual network, as there are no other devices that could be snooping.

Check SMB Settings

By default SMB is enabled, but I discovered I needed to enable SMB version 3.0 on the Synology!  You'll find this under the "Advanced" SMB settings. 

Create a "New Folder"

Creating an account by itself does not create a Share/Folder that can be accessed from a remote client.  You'll need to create a new folder as well.  Again, the UI is intuitive and you should be able to navigate to "Folders" in the control panel, and create a new one, giving your user account created in the previous step "Customized" permissions.  I enabled "Full Control".  

Also, when creating the folder I set a password and enabled disk Encryption.  Filename lengths are restricted to ~170 characters in your storage folder if encryption is enabled.

Mount the Synology Share using CIFS

You'll need to install 'cifs-utils' using apt-get install first.  Then you can easily add the entry to the /etc/fstab using sudo.

Note the 'user' option.  This allows you to mount with the 'vubuntu' user, making it read/write approved for the SSH User.  Using `sudo mount` works too, but then accessing the VM remotely would require an SSH as root.  You can only SSH as root after modifying the "PermitRootLogin" setting in /etc/ssh/sshd_config.

Was all that Worth it???

I would have to say it was.  The goal was to back up my Desktop PC's data to the Synology, and I've achieved peek throughput of 540 Mbps while using WinSCP to move files from the Desktop's E:\ Storage drive to the Synology over the Cat5 cable.  Which is 67.5MB/sec.

While the connection is 1Gbps, Secure Shell and Virtualization are at play.  Again, this isolates the Synology from the web, while still providing high throughput.  Don't forget to run your Virus Scan on files before backing them up!

No comments:

Post a Comment