First, log into the VM using gcloud compute ssh VM_NAME
or web ssh(by clicking ssh
on the GCP console.
Then edit /etc/ssh/sshd_config
and change PasswordAuthentication no
to PasswordAuthentication yes
and restart sshd service: systemctl restart sshd
After that, you can add user and grant password adduser testuser
Then you can use username and password to log into the VM: ssh testuser@PUBLIB_IP_OF_VM
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.