Method: users.importSshPublicKey Stay organized with collections Save and categorize content based on your preferences.
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 usesgRPC Transcoding syntax.
Path parameters
| Parameters | |
|---|---|
parent |
The unique ID for the user in format |
Query parameters
| Parameters | |
|---|---|
projectId |
The project ID of the Google Cloud Platform project. |
view |
The view configures whether to retrieve security keys information. |
regions[] |
Optional. The regions to which to assert that the key was written. If unspecified, defaults to all regions. Regions are listed athttps://cloud.google.com/about/locations#region. |
Request body
The request body contains an instance ofSshPublicKey.
Response body
A response message for importing an SSH public key.
If successful, the response body contains data with the following structure:
| JSON representation |
|---|
{"loginProfile":{object ( |
| Fields | |
|---|---|
loginProfile |
The login profile information for the user. |
details |
Detailed information about import results. |
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/cloud-platformhttps://www.googleapis.com/auth/compute
For more information, see theAuthentication Overview.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-28 UTC.