Your team wants to let contractors open an SSH session to a Linux VM directly from the Google Cloud console by clicking the "SSH" button in the VM instances list. The VM has an external IP and no existing ingress rules. The contractors must not install the gcloud CLI or manage SSH keys locally. Which single configuration change is required so the browser-based SSH connection succeeds while keeping access as restrictive as possible?
Create an ingress firewall rule that allows TCP 22 from source range 35.235.240.0/20 in the VPC network where the VM resides.
Enable OS Login at the project level so Compute Engine injects temporary SSH keys for the contractors.
Attach a Cloud NAT gateway to the subnet so the VM can establish outbound connections for the SSH session.
Add an ingress firewall rule that allows TCP 22 from source range 0.0.0.0/0 to the VM's network tags.
When you click the SSH button in the console, the browser connects through Google's SSH relay service, which then initiates an SSH session to the VM on TCP port 22. The traffic arrives at the VM with a source IP in the range 35.235.240.0/20. If no firewall rule allows this range, the connection times out. Creating an ingress rule that permits TCP 22 only from 35.235.240.0/20 satisfies the relay service while limiting exposure. Allowing 0.0.0.0/0 is overly broad, enabling OS Login does not address the blocked port, and Cloud NAT is irrelevant because the VM already has an external IP and the issue is inbound, not outbound.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
Why does the source IP range need to be restricted to 35.235.240.0/20?
Open an interactive chat with Bash
What is the role of ingress firewall rules in Google Cloud?
Open an interactive chat with Bash
Why are Cloud NAT and OS Login not relevant to this solution?
Open an interactive chat with Bash
What is an ingress firewall rule in Google Cloud Platform (GCP)?
Open an interactive chat with Bash
Why does the SSH button in the Google Cloud console use the IP range 35.235.240.0/20?
Open an interactive chat with Bash
Why is it better to use a specific source range like 35.235.240.0/20 instead of 0.0.0.0/0 for SSH access?
Open an interactive chat with Bash
GCP Associate Cloud Engineer
Ensuring successful operation of a cloud solution
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .