The connection tool used for this time is Tera term.
The total steps are
{
1: Generate SSH keys, including public and private keys.
2: Upload the public key to Google.
3: Log on locally with the private key authentication.
}
1.1 Open Tera Term
1.2 Select "Set->ssh key generation".
1.3 Type Select "RSA" and click "Generate Key".
1.4 Enter the following parameters and click "Save As Public key" and "Save as private key".
Note:< user name for login >
Key password:< login password >
Confirm Password:< login password >
1.5 Get the following two files:
2.1 Sign in to Google Cloud and go to compute Engine and select "Metadata".
2.2 Click on the "SSH" tab on the right, tap the "Edit" button to enter the editing interface.
2.3 Open the [id_rsa.pub] file created in step 1.5 and copy all the text inside.
2.4 Go back to Google Cloud and click "Add an Item". Paste the text into it and click "Save".
3.1 Your public IP, public IP can be seen here.
3.2 Open Tera Term, enter the host IP in the connection parameters and click "OK"
3.3 Enter the account number and password you set in step 1.4, select the "id_rsa" file you obtained in step 1.5
Final login successful, enjoy.
4.1 Open the Script Editor.
Use the Tera term script to create an automatic logon script.
4.2 We use the template to create, check the SSH2 connection
4.3 appropriate changes to some parameters, lazy words, you can directly remove the password in the script.
Here the main need to modify is the IP, private key file path.
4.4 Click the Green Triangular "Run" button on the menu bar to test.
4.5 The operation of selecting the key is automatically implemented by the script and the login is successful.
The following is a lazy script to write, the account password directly into the script.
Thank you for viewing:)
Connecting a Googlecloud Linux virtual machine via a local client