Reputation: 10349
I've successfully created and logged into a GCE VM with ssh -i ~/.ssh/google_compute_engine <EXTERNAL IP>
.
The VM is running ubuntu 18.04 LTS. I've installed zsh. I've verified that the output of which zsh
appears in /etc/shells
.
When I try to run chsh -s $(which zsh)
I'm prompted for a password and I have no idea what to enter.
When I created ~/.ssh/google_compute_engine
(which was created during a gcloud ssh
command issued earlier) I didn't enter a passphrase for the ssh key.
How can I change my shell?
EDIT: Here's what I see when I've logged in:
paymahn@paymahn:~$ chsh -s $(which zsh) Password: chsh: PAM: Authentication failure
Upvotes: 7
Views: 4458
Reputation: 4048
Don't need to create a password, just use sudo
# for current logged user
sudo chsh -s /bin/zsh "$USER"
Upvotes: 7
Reputation: 512
Clarifying/combining existing answers (here's what worked for me anyway):
sudo passwd $USER
, to give yourself a passwordchsh -s /bin/zsh $USER
(without the sudo
prefix)Upvotes: -1
Reputation: 1776
In GCP VM's they don't come with a password by default so you'll first need to change the password using sudo passwd
then you can use the root password for your zsh
shell.
Upvotes: 1
Reputation: 10349
Ok, figured it out, kinda. I don't think I had a password set at all. I ran sudo passwd paymahn
to create a password and then used the newly created password during the prompt for chsh
.
Upvotes: 0