How to set the default shell when chsh is not present

I've a Synology DS412+ NAS box running Busybox, which has a default shell of ash. Previously, ipkg install optware-devel was run and it installed bash and set it as the default shell. Running ipkg install zsh has installed zsh but not set it as the default shell. chsh is not present (Busybox assumes a cut down system and only ash will be used), so how do I set the default shell?

I'd be very grateful for any help or insight .


Solution 1:

You can change the login shell by editing /etc/passwd. Each line is a list of colon-separated values, the last of which is the login shell:

user:x:1000:1000:User:/home/user:/usr/bin/zsh

If /etc/shells exists, you should add zsh (full path) to it, else some services may not work for your user.

Note:

I'd suggest against changing the login shell for root (or any user you need for administrative purposes) if zsh is installed on one of the disks. You may want to still have root access without installed disks.

You always could start zsh automatically from ash's user configuration. Something like that

[ -x /usr/bin/zsh ] && exec /usr/bin/zsh