gcloud alpha compute os-login ssh-keys update Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud alpha compute os-login ssh-keys update - update an SSH public key in an OS Login profile
- SYNOPSIS
gcloud alpha compute os-login ssh-keys update--ttl=TTL(--key=KEY|--key-file=KEY_FILE)[GCLOUD_WIDE_FLAG …]
- DESCRIPTION
(ALPHA)gcloud alpha compute os-login ssh-keys updateaccepts either a string containing an SSH public key or a filename for an SSHpublic key, and updates the key in the user's OS Login profile. Currently, onlythe expiration time,, can be updated.--ttl- EXAMPLES
- To update the SSH public key found in
/home/user/.ssh/id_rsa.pubwith an expiration time of one week from now, run:gcloudalphacomputeos-loginssh-keysupdate--ttl=7d--key-file=/home/user/.ssh/id_rsa.pubTo update the SSH public key with a fingerprint of'e0d96d6fad35a61a0577f467940509b5aa08b6dea8d99456ec19a6e47126bc52' and anexpiration time of five years from now, run:
gcloudalphacomputeos-loginssh-keysupdate--ttl=5y--key='e0d96d6fad35a61a0577f467940509b5aa08b6dea8d99456ec19a6e47126bc52' - REQUIRED FLAGS
--ttl=TTL- The amount of time before the SSH key expires. For example, specifying
will set the expiration time on the SSHkey for 30 minutes from the current time. A value of 0 will result in noexpiration time. See $gcloudtopic datetimes for information on duration formats.30m - Exactly one of these must be specified:
--key=KEY- The SSH public key to update the OS Login Profile. Key value can either be theSSH key or the OS Login fingerprint of the key.
--key-file=KEY_FILE- The path to a file containing an SSH public key to update the OS Login Profile.Key value can either be the SSH key or the OS Login fingerprint of the key.
- GCLOUD WIDE FLAGS
- These flags are available to all commands:
--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.Run
$gcloud helpfor details. - NOTES
- This command is currently in alpha and might change without notice. If thiscommand fails with API permission errors despite specifying the correct project,you might be trying to access an API with an invitation-only early accessallowlist. These variants are also available:
gcloudcomputeos-loginssh-keysupdategcloudbetacomputeos-loginssh-keysupdate
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-05-07 UTC.