Skip to main content

ssh command group

note

This information applies to Databricks CLI versions 0.205 and above. The Databricks CLI is in Public Preview.

Databricks CLI use is subject to the Databricks License and Databricks Privacy Notice, including any Usage Data provisions.

Beta

The Databricks SSH tunnel is in Beta.

The ssh command group within the Databricks CLI allows you to set up and establish SSH connections to Databricks compute. See Databricks SSH tunnel.

databricks ssh connect

Connect to Databricks compute via SSH. This command establishes an SSH connection to Databricks compute, setting up the SSH server and handling the connection proxy.

databricks ssh connect [flags]

Options

--cluster string

    Databricks cluster ID. Required.

--auto-start-cluster

    Automatically start the cluster if it isn't running. Default: true.

--max-clients int

    Maximum number of SSH clients. Default: 10.

--shutdown-delay duration

    Delay before shutting down the server after the last client disconnects. Default: 10m0s.

Global flags

Examples

The following example connects to a cluster:

Bash
databricks ssh connect --cluster 0123-456789-abcdefgh

The following example connects to a cluster using a specific profile:

Bash
databricks ssh connect --cluster 0123-456789-abcdefgh --profile my-profile

The following example connects with a custom shutdown delay:

Bash
databricks ssh connect --cluster 0123-456789-abcdefgh --shutdown-delay 30m

databricks ssh setup

Set up SSH configuration to connect to Databricks compute. This command adds an SSH host configuration to your SSH configuration file.

databricks ssh setup [flags]

Options

--cluster string

    Databricks cluster ID.

--name string

    Host name to use in SSH config.

--auto-start-cluster

    Automatically start the cluster when establishing the SSH connection. Default: true.

--shutdown-delay duration

    SSH server terminates after this delay if there are no active connections. Default: 10m0s.

--ssh-config string

    Path to SSH config file. Default: ~/.ssh/config.

Global flags

Examples

The following example sets up SSH configuration for a cluster:

Bash
databricks ssh setup --name my-cluster --cluster 0123-456789-abcdefgh

After running setup, you can connect using the standard SSH client:

Bash
ssh my-cluster

Global flags

--debug

  Whether to enable debug logging.

-h or --help

    Display help for the Databricks CLI or the related command group or the related command.

--log-file string

    A string representing the file to write output logs to. If this flag is not specified then the default is to write output logs to stderr.

--log-format format

    The log format type, text or json. The default value is text.

--log-level string

    A string representing the log format level. If not specified then the log format level is disabled.

-o, --output type

    The command output type, text or json. The default value is text.

-p, --profile string

    The name of the profile in the ~/.databrickscfg file to use to run the command. If this flag is not specified then if it exists, the profile named DEFAULT is used.

--progress-format format

    The format to display progress logs: default, append, inplace, or json

-t, --target string

    If applicable, the bundle target to use