Use `chsh` on GCP VM in order to change from bash to zshell, default password is unknown
I'm trying to change the default shell on a GCP VM but am running into difficulties trying to use chsh.
It seems that I have access to root as I am able to run sudo apt upgrade
.
I have also installed zshell:
user_name@instance_name:~$ which zsh
/usr/bin/zsh
But when trying to change the shell I get the following:
user_name@instance_name:~$ chsh -s $(which zsh)
Password:
And I have no idea what the password is, I tried just pressing RET
but got:
user_name@instance_name:~$ chsh -s $(which zsh)
Password:
chsh: PAM: Authentication failure
And am not sure what I'm supposed to do. The output of $USER
(if it's of use) is the following:
user_name@instance_name:~$ echo $USER
user_name
The instance was created with the following command:
gcloud compute instances create $INSTANCE_NAME \
--zone=$ZONE \
--image-family=$IMAGE_FAMILY \
--image-project=deeplearning-platform-release \
--maintenance-policy=TERMINATE \
--accelerator="type=nvidia-tesla-p100,count=1" \
--machine-type=$INSTANCE_TYPE \
--boot-disk-size=200GB \
--metadata="install-nvidia-driver=True" \
--preemptible
If there's any other information that I should share please let me know.
So GCP VM has no default password and you should set it first. For this you can do something like this:
sudo passwd <user>
After setting the password, you can now set the default shell to zsh by:
chsh -s $(which zsh) <user>
Enter the new password and the default shell should be changed.