-
-
Save aaabramov/0f1d963d788bf411c0629a6bcf20114d to your computer and use it in GitHub Desktop.
sudo yum update | |
# Installing ZSH | |
sudo yum -y install zsh | |
# Check ZSH has been installed | |
zsh --version | |
# Install "util-linux-user" because "chsh" is not available by default | |
# See https://superuser.com/a/1389273/599050 | |
sudo yum install util-linux-user | |
# Change default shell for current user, most of the times it would be "ec2-user" | |
# Or use "sudo chsh -s $(which zsh) $(whoami)" to be sure | |
chsh -s "$(which zsh)" | |
# Install oh-my-zsh from https://github.com/ohmyzsh/ohmyzsh#basic-installation | |
# OPTIONAL | |
# I recommend you to install the following plugins which make your life easier and more colorful | |
# Assuming you have git installed | |
# If not, simply do "sudo yum install git -y" | |
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting | |
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions | |
# And then add them to "~/.zshrc" file | |
plugins=(git zsh-autosuggestions zsh-syntax-highlighting) |
to get this working using ssh - and reconnecting - https://askubuntu.com/questions/131823/how-to-make-zsh-the-default-shell I needed to connect to server - and change the /home/ec2-user/.bashrc exec zsh
@johndpope Have you executedchsh -s "$(which zsh)"
?
Install oh-my-zsh before the optional part from 19 onwards by executing the following command.
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Ran into an issue with executing chsh
but found a post on setting a password for the default user ec2-user.
sudo passwd ec2-user
After setting the password the script ran without error.
It looks like Amazon Linux 2 AMI installs zsh shell 5.0.2 by default. Is there a channel that can be used to grab a newer zsh install?
@tbenavides - I had a similar issue when a "regular user" was trying to change the shell. I was able to run
sudo usermod --shell $(which zsh) the_user_id
and get it changed for him and we did not have to set a blank password
to get this working using ssh - and reconnecting -
https://askubuntu.com/questions/131823/how-to-make-zsh-the-default-shell
I needed to connect to server - and change the
/home/ec2-user/.bashrc
exec zsh