gcloud compute ssh: ERROR: (gcloud.compute.start-iap-tunnel) Error while connecting [4033: 'not authorized']
SSH through Identity-Aware Proxy failed because you lack IAP tunnel permission or the firewall doesn't allow IAP's range.
Error while connecting [4033: 'not authorized']ERROR: (gcloud.compute.start-iap-tunnel) Error while connecting [4003: 'failed to connect to backend']gcloud compute ssh IAP tunnel not authorizedfailed to connect to backend 4003 IAP Meaning
Grant roles/iap.tunnelResourceAccessor, allow ingress from 35.235.240.0/20 on port 22, and make sure the VM and instance exist. Error 4003 means the instance isn't listening or the firewall blocks; 4033 means no permission.
Common causes
- Missing roles/iap.tunnelResourceAccessor
- Firewall doesn't allow 35.235.240.0/20 to tcp:22
- Wrong VM name/zone
- Org policy restricting IAP
- OS Login permissions missing (roles/compute.osLogin)
⚡ Quick fix
gcloud projects add-iam-policy-binding PROJECT --member=user:you@example.com --role=roles/iap.tunnelResourceAccessor- Create a firewall rule allowing 35.235.240.0/20 to tcp:22
- Use
--tunnel-through-iapwith the right zone
Detailed fix by platform
gcloud
gcloud compute firewall-rules create allow-ssh-iap --network default --allow tcp:22 --source-ranges 35.235.240.0/20
How to diagnose
- Code — 4033 or 4003?
- Role — iap.tunnelResourceAccessor?
- Firewall — IAP range allowed?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- 409: The resource already exists Compute Engine: ERROR: (gcloud.compute.instances.create) Could not fetch resource: The resource 'projects/p/zones/z/instances/vm-1' already exists
- API has not been used in project before or it is disabled Google Cloud: 403 SERVICE_DISABLED — Cloud Resource Manager API has not been used in project 123456 before or it is disabled. Enable it by visiting
- Artifact Registry: Permission artifactregistry.repositories.uploadArtifacts denied Docker push: denied: Permission "artifactregistry.repositories.uploadArtifacts" denied on resource "projects/p/locations/l/repositories/r"
Most viewed in Google Cloud / Firebase
- Missing or insufficient permissions Firestore: FirebaseError: [code=permission-denied]: Missing or insufficient permissions
- Container failed to start Cloud Run: The user-provided container failed to start and listen on the port defined provided by the PORT=8080 environment variable
- Could not load the default credentials Google Cloud: Error: Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started
Other ways to find it
Where this error sits
Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 4 Nov 2026