---
title: Connect serverless compute to on-premises resources using an SSH reverse tunnel
description: Use an SSH reverse tunnel to connect serverless compute to on-premises resources when your firewall blocks inbound traffic from the cloud.
canonical_url: https://docs.databricks.com/gcp/en/security/network/onprem/reverse-ssh
---

# Connect serverless compute to on-premises resources using an SSH reverse tunnel

An SSH reverse tunnel connects serverless compute to on-premises resources without opening inbound ports on your on-premises firewall. An on-premises host opens an outbound SSH connection to proxy VMs in your Google Cloud environment, which gives serverless compute a secure, encrypted path to your on-premises resources.

This is a self-managed solution. You provision, monitor, and maintain the proxy VMs and the on-premises tunnel host.

## What problem it solves

An SSH reverse tunnel establishes a dedicated, private connection from serverless compute to on-premises resources without requiring you to open an inbound port on your on-premises firewall. The on-premises host initiates the connection outbound, and traffic from serverless compute flows back over the established tunnel.

## When to use an SSH reverse tunnel

Use an SSH reverse tunnel when your on-premises resources are reachable from the cloud over an existing network path, such as Cloud Interconnect, a site-to-site VPN, or SD-WAN, but your corporate firewall blocks inbound traffic from the cloud.

## How it works

1. On-premises tunnel hosts run `autossh` to establish outbound SSH connections to proxy VMs in Google Cloud.
2. The proxy VMs run `socat` to accept the tunnels and expose resource ports on their network interfaces.
3. Databricks connects to the proxy VMs from a private endpoint in your network connectivity configuration (NCC), through a load balancer that is exposed through a Private Service Connect service attachment.
4. Serverless traffic flows through the tunnel to the on-premises resources.

For detailed setup steps, see [Connect to on-premises resources using an SSH reverse tunnel](https://docs.databricks.com/gcp/en/security/network/serverless-network-security/ssh-reverse-tunnel.md).

## Considerations

Review the following before you use an SSH reverse tunnel:

* This is not a managed solution. You must provision, monitor, and maintain infrastructure both in the cloud and on-premises, which adds cost and operational overhead.
* Add at least two proxy VMs to the load balancer backend pool so that a tunnel failure on a single VM doesn't block connectivity.
* Each proxy VM requires a distinct port mapping for each on-premises resource.

## Additional resources

* [Connect to on-premises resources using an SSH reverse tunnel](https://docs.databricks.com/gcp/en/security/network/serverless-network-security/ssh-reverse-tunnel.md)
* [Configure private connectivity to resources in your VPC](https://docs.databricks.com/gcp/en/security/network/serverless-network-security/pl-to-internal-network.md)
