After installing Entware, the next thing I did was configure my shell environment to provide a better CLI experience. The default shell is terribly basic!

Here's what I did:

  1. I installed Entware.

  2. I installed a few packages: sudo opkg install zsh curl git git-http coreutils-mkfifo tmux.

  3. I configured my account to use Zsh instead of the default /bin/sh. Normally you'd do this by using chsh or editing /etc/passwd directly to use /opt/bin/zsh as your new shell.

    However in this case I did it a bit differently for a couple of reasons:

    • in my experience with Synology NAS, OS upgrades tend to reset the shell in /etc/passwd to the default one (not sure if QNAP does the same, I guess we'll see)
    • if you mess with your Entware install and /opt/bin/zsh becomes unavailable, you may find yourself locked out of your account.

    Instead, I edited my .profile file with vim ~/.profile and added these lines at the end:

if [[ -x /opt/bin/zsh ]]; then
  export SHELL=/opt/bin/zsh
  exec /opt/bin/zsh
fi

This way, if /opt/bin/zsh is no longer available, you can stil log into your account -- it'll just fall back to the default /bin/sh shell.

  1. Log out and back in, and configure Zsh with some basic settings.

The next steps are absolutely not specific to QNAP and are purely down to personal preference, but I'm listing them anyway:

  1. Install Oh My Zsh using the convenient script.

  2. Install Powerlevel10k using the installation instructions for Oh My Zsh (and install the recommended font for your terminal if you haven't already).

Now you can enjoy a modern, good looking CLI when ssh'ing into your NAS!