Method: users.importSshPublicKey

Adds an SSH public key and returns the profile information. Default POSIX account information is set when no username and UID exist as part of the login profile.

HTTP request

POST https://oslogin.googleapis.com/v1beta/{parent=users/*}:importSshPublicKey

The URL uses Google API HTTP annotation syntax.

Path parameters

Parameters
parent

string

The unique ID for the user in format users/{user}.

Query parameters

Parameters
projectId

string

The project ID of the Google Cloud Platform project.

Request body

The request body contains an instance of SshPublicKey.

Response body

If successful, the response body contains data with the following structure:

A response message for importing an SSH public key.

JSON representation
{
  "loginProfile": {
    object(LoginProfile)
  }
}
Fields
loginProfile

object(LoginProfile)

The login profile information for the user.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/compute

For more information, see the Authentication Overview.

Try it!

Was this page helpful? Let us know how we did:

Send feedback about...

Compute Engine