Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Associate Cloud Engineer practice bank has an additional 2,014 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
An administrator needs to provide a temporary contractor with access to several Linux Compute Engine instances. Company policy mandates that temporary SSH keys must automatically expire after a specific timestamp without requiring manual administrative cleanup.
How should the administrator format the SSH key entry when adding it to the project or instance metadata?
Linux systems traditionally manage SSH public keys via the ~/.ssh/authorized_keys file located in each user's home directory. A local cron job can be configured within the guest operating system to run scheduled shell scripts that edit system files.
~/.ssh/authorized_keys can result in changes being overwritten when metadata syncs.This approach would be appropriate in unmanaged, standalone on-premises Linux servers that do not possess a cloud metadata service or guest management agent.
The gcloud compute instances create command is used to provision new virtual machine instances in Compute Engine. It allows configuration of machine types, boot disks, network interfaces, and metadata values.
gcloud compute instances create command does not have a native --ttl (time-to-live) flag for automatically expiring individual SSH keys added to metadata.ssh-keys metadata attribute, which requires specific internal formatting for expiration rather than top-level CLI flags.This option would be correct if the requirement was to automatically terminate or delete the entire virtual machine instance after a fixed duration using an instance scheduling policy or script.
Google Cloud Compute Engine supports automated lifecycle management for standard metadata SSH keys by allowing JSON-structured metadata attributes to be appended to the public key string. This structured format contains parameters including the target username and an explicit expiration timestamp (expireOn).
KEY_VALUE google-ssh {"userName":"USERNAME","expireOn":"EXPIRE_TIME"} is stored in metadata, the guest environment running inside the Compute Engine Linux VM inspects the expireOn value.EXPIRE_TIME is specified in standard ISO 8601 format (for example, 2024-12-04T20:12:00+0000). Once the current system time passes this timestamp, the VM guest agent automatically invalidates the key and prevents further SSH authentication.
Using native google-ssh metadata with an expireOn property is the standardized, platform-supported mechanism for defining expiring SSH keys in Compute Engine metadata. It eliminates the risk of orphaned credentials and avoids the operational complexity of custom in-guest cleanup scripts.
Identity and Access Management (IAM) Conditions allow administrators to define conditional access policies based on resource attributes, request time/date, or access levels. A time-based condition can grant or revoke specific Google Cloud IAM roles (such as Compute Instance Admin) at a designated timestamp.
This answer would be correct if the goal was to restrict when an administrator has permission to execute Google Cloud CLI management commands against Compute Engine API endpoints.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated