Making Synology NAS command line usable
My Synology automation scripts
This project should be converted to Ansible. Any volunteers?
I have a Synology DS214play NAS box and its command line is pretty limited. Most of the commands are trimmed down copies of their UNIX counterparts. I like my NAS being NAS, but I also wanted to be able to do useful things with it, assuming it's powered 24/7. To make its command line usable for myself in a long-term, I decided to spend some time on proper configuration. Unfortunately my NAS model isn't permitted to use Synology's Docker package, so the whole activity included:
ipkginstallation: this will give you basic commands such as
Debian chroot: this will let you run a Debian userland, which gives you
apt-getand the possibility of running all sorts of stuff on your Synology box. I found it useful when experimenting with command-line backup solutions such as
zbackup, which don't exist in
I stole some ideas from:
How to use
- Enable SSH on your Synology http://forum.synology.com/wiki/index.php/Enabling_the_Command_Line_Interface
- Go to https://synocommunity.com/ and add the Community Packages to Synology software sources.
- From the community packages tab, install Python.
- From the community packages tab, install Debian chroot.
- Upon installing, start Debian chroot.
SSH to your NAS:
Get the simple Python script which imitates
wget, but unlike Synology's
wget(1) has HTTPS support (http://www.koszek.com/blog/2015/10/04/wget-in-9-lines-of-python-for-hostile-environments/):
wget -O - 'http://pastebin.com/raw.php?i=PcbNtyh9' | tr '\r' ' ' > wget2 chmod 755 wget2 ./wget2 https://github.com/wkoszek/synology/archive/0.1.1.tar.gz gunzip 0.1.1.tar.gz tar xf 0.1.1.tar cd synology-0.1.1 ./bootstrap.sh
(you may want to pick the latest
This should initiate the bootstrap procedure.
What bootstrap does for you
bootstrap.sh following things will happen:
ipkgwill be fetched and installed.
- ASH config will be updated to add
.profilewill be updated with some usable aliases and mandatory settings
- SSH keys will be generated.
- SSH configuration will be installed for GitHub.com in case you want to push from your NAS
- Updated start script for Debian chroot will be installed. It basically mounts home directories in the chroot directory, and also adds USB-mounted volumes there.
- Debian's chroot environment will be started and updated.
- Informational message will be printed.