- Connect to your EC2 instance
- Install zsh :
sudo apt-get update && sudo apt-get install zsh
- Edit your passwd configuration file to tell which shell to use for user
ubuntu
:sudo vim /etc/passwd
- Look for
ubuntu
user, and replacebin/bash
bybin/zsh
- Install OhMyZsh :
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
- Disconnect from your instance and reconnect it.
Last active
May 6, 2024 06:15
-
-
Save anthonyray/398fde676a7704c03d6624155ba0011e to your computer and use it in GitHub Desktop.
Set up OhMyZsh on Amazon EC2 instance running Ubuntu Server 14.04
Thanks for this,
chsh -s /bin/zsh
didn't work and I was looking for an alternative.
You can run sudo chsh -s /bin/zsh ubuntu
to change the user ubuntu's default shell. Replace 'ubuntu' with your username. You will have to logout and log back in (or change source manually) to see the change take effect
Combining the original solution with instance user data, you can add the following script to the instance's user-data, and then you'll have zsh
installed when the instance is ready.
Very handy when using EC2 Launch Template
#!/bin/bash
sudo apt-get update && sudo apt-get install -y zsh && \
sudo chsh -s /bin/zsh ubuntu && \
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
Thanks, for this.
Added an updated version here: https://gist.github.com/sandiprb/771bcbd100a3ebf53682903a627a40df
Thanks for this!
this works on Oracle VPS too, thanks.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks because the chsh for root didn't work for me too