Sigh, I made the same stupid mistake. However, I managed to recover with the method mentioned! (Thanks!!) I couldn't even use su or sudo because it wasn't installed.
I installed the "Config File Editor" package from
http://www.mertymade.com/syno/#cfeThen edited the "Config File Editor" config itself to add /etc/passwd as one of the editable files.
Luckily it worked, I changed the shell back to /bin/ash
However, after doing so, I was unable to login via ssh, I kept getting an odd error:
PTY allocation request failed on channel 0
So I turned the ssh server on and off via the web control panel and it works now.
Phew, dabbling with root settings is a bad idea.