i'd like to have a system wide oh-my-zsh setup, but i'm not sure what would be the "best" approach for this. It is not my intention to ask about personal preferences or the like, i'm just unsure whether the solutions below are
Fair Warning: this assumes a Debian style linux, but this should work on other forms as well. This also assumes you are starting from scratch.
Part 1, the install:
You will need to install zsh system wide, and not just for one user. (you may have already done this but I'll include it just to be comprehensive)
make sure you have installed zsh, simply:
sudo apt-get install zsh
Follow the oh-my-zsh install guide or you can either:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
Part 2, Setting up zsh when new users are added:
You will need to make it so that new users default to zsh. In your
/etc/adduser.conf file edit the line that says:
You should also change it for the
/etc/default/useradd file, change the line:
Part 3, set your custom theme.
I have a custom theme file (here) that I wanted all users on the system to have. First, you should add the file to your
cp your_custom_style.zsh-theme ~/.oh-my-zsh/themes
Next, edit your
.zshrc file in your home directory, change the
Then, reload your
.zshrc file with:
Part 4, setting up new user's home directories.
We need to to place whatever files we want the new users to have in the
/etc/skel directory, because this is what the system copies when it is creating new user's home directory. See this sys admin guide for details.
Copy your user's files (you may need to sudo):
cp -r .oh-my-zsh /etc/skel/ cp .zshrc /etc/skel
Now you will be able to add new users and they will have oh-my-zsh by default with whatever custom theme you want them to have.
If you want to change all other existing user's shell to zsh, I would recommend reading this serverfault question.