RHEL 7 and using zsh as default shell for root

Latest response

Is there any known issue if I switch my root user to zsh from bash starting with RHEL/CentOS 7?

I have tried this with a CentOS 7 installation and have not seen any adverse effects thus far but I was curious if anyone else has any experience on this. My main reason is quite much making some admin work faster with utilizing some of the autocompletion scripting that is available for zsh via suitable rc files (e.g. http://grml.org/zsh/).

Responses

Hi Jukka,

Just a few thoughts, there's more to consider than the few bits below...

What was the compelling reason / factor you wanted to switch the root user's default shell to zsh? I'd examine your environmental variables for both shells to see if things are proper, including (and certainly -not- limited to) root's $PATH.

There's other factors to consider, such as if you have specific profiles directives in .bashrc or .bash_profile, these will be bypassed.

Basically the zshrc rc files that I consider using implement tab completion for every single command by testing if the command has a --help query for the thus far written portion of the command and offers next alternatives to use with the command line. It works also if you have written a portion of the next command it finds multiple choices starting with that letter. I'd recommend that you test it yourself by downloading those rc files as instructed on the page http://grml.org/zsh and fire up a zsh shell. That way you can see the ease of use it enables as I will propably mess up explaining my points by writing about it.

Also there are interesting little extras e.g:

% vi notes.txt
zsh: correct 'vi' to 'vim' [nyae]?

This correction works also when you have mistyped your command by offering alternatives you may have meant or just chancing to the most propable one if you have mistyped it some other way.

I'm sorry to say that in portion this is to ease the move into systemd as it has so many different commands to use that the learning curve is a bit steep to get into it for some.

No real differences with environmental variables when running with zsh as root, $PATH is good. I can understand your point on .bashrc however considering how it sources /etc/bashrc as well. My point is only to chsh the root user, not switch everything in the system to zsh.

The only other immediate bit I can think of in light of this, if you have a cron running some script (including ones that are written at a later date), it may fail because of a 'spelling correction' perhaps. Hopefully not... If you use the full path in any scripts (typically a good idea), that will probably avert that.

Sounds like you're testing this - hope it goes well.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.