root 安装 zsh

yum install -y zsh
chsh -s /bin/zsh

安装 oh-my-zsh

yum install -y git
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

通过以上两步 root 用户可以使用 oh-my-zsh

普通用户 test, 使用 oh-my-zsh

在 root 装好 oh-my-zsh 后

拷贝配置文件

su - root
useradd test
passwd test

cp -r ~/.oh-my-zsh/ /home/test/ 
cp ~/.zshrc /home/test/
cd /home/test/
chown -R test:test .oh-my-zsh
chown test:test .zshrc

配置

su - test
chsh -s /bin/zsh
vi ~/.zshrc
export ZSH="/home/test/.oh-my-zsh" # 修改此项
. ~/.zshrc