Is changing root's shell from Bash to Zsh in a Ubuntu machine with a basic server environment a dangerous step to take?

By basic server environment I mean: LAMP, PHPmyadmin, CSF-LFD, Maldet, Make).

I thought of fully reinstalling the server environment this time with Zsh but when I install Ubuntu in my Hosting platform - DigitalOcean it automatically comes with Bash.

The server environment setup script I use to actually establish a good, stable server environment usually includes these (besides various apt-gets):

heredocuments (especially cat heredocs), sed operations, awk operations, wgets, echo strings, bash strings (see an example in advance), hash comments, etc. Should these things work regularly in Zsh too?

By Bash string I mean, for example:

bash -c "echo 'alias www=\"cd /var/www/html\"' >> /etc/bash.bashrc"

Note: The reason I consider working with Zsh is to enjoy the preexec behavior.


Reinstalling all the environment is IMHO an overkill. zsh is a package like many others, you can just run sudo apt install zsh and use it.

I haven’t tested zsh personally yet but it should make no difference when using external commands like apt-get, sed, awk, wget and so on. You should check the support of shell features like heredoc and echo (which is internal command in Bash). Your “Bash string” should work as long as you don’t uninstall Bash (don’t do it) but it probably wouldn’t affect zsh.

Of course, you should test the changes (like any others) before you deploy them in the production environment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy