So, let's install BASH, because it's an aweseome shell, and installing it is super-easy. This assumes you've already bootstrapped your NAS with the IPKG installation.
First we will install the BASH package using IPKG
ipkg install bash
Next we will tell the system that we prefer BASH over ASH, thank you very much. We will do this by editing the /etc/passwd file. Be very very very careful editing this file, as if you muff it up then you might not be able to log into your system!
So, let's be super extra careful and make a back-up of the file, just in case.
cp /etc/passwd ~/just-in-case
Now we'll edit the file
Look for a line like this:
We want to change the end bit to point to bash, so we change "/bin/ash" to "/opt/bin/bash". When you're done it will look like this (!!see 'update' below!!):
Save the file, but DO NOT exit your ssh session! First, test our modification by attempting to log in again from another ssh window. If you cannot log in for whatever reason, then restore the file and try again
cp ~/just-in-case /etc/passwd
If you can login, then you delete the backup file and Bob's yer uncle.
The man page for BASH is a fantastic wealth of information.
Read it. Know it. Love it.
As mentioned above, if you muff things up here you might end up unable to log into your Synology. Well just that happened to me when I updated the DSM and somehow lost my bash binary. Login attempts now result in "/opt/bin/bash: No such file or directory".
If you fall into this trap as well, you can try reseting your firmware by following these instructions.
To prevent this in the future, a user in the Synology forum suggested leaving the /etc/passwd file as-is and adding this to your .profile. I heartily agree.
if [ -x /opt/bin/bash ]; then
Also, you should fix the SUID permission on the "su" binary (which just links to "busybox" so you can execute fix other issues should your root user become corrupt.
Plus, if your NAS is visible to the internet, consider disabling the "root" user altogether and creating a different user for root access. I've detailed that in this post.