sshgoogle-cloud-platformvirtual-machinegoogle-compute-engine

setting up global gcp vm


I need help setting up VM using GCP, this is my first VM on GCP

How can I set it up so anyone that has username@IP and password to be able to login

i.e (ssh user@IP password)

enter image description here


Solution

    1. Log into the VM using:

      gcloud compute ssh VM_NAME
      

      or via web SSH (by clicking "ssh" on the GCP console).

    2. Edit /etc/ssh/sshd_config and change PasswordAuthentication no to PasswordAuthentication yes.

    3. Restart sshd service:

      systemctl restart sshd
      
    4. Add the user and grant password:

      adduser testuser
      
    5. Uuse username and password to log into the VM:

      ssh testuser@PUBLIB_IP_OF_VM