# keychaincredential.setup_ssh_connection

Creates an SSH Connection performing the following steps:

1. Generate SSH Key Pair if required 2) Set up SSH Credentials based on setup_type

In case (2) fails, it will be ensured that SSH Key Pair generated (if applicable) in the process is removed.

Type: object

##

Type: array
No Additional Items

#### Tuple Validation

##### Parameter 1: options

#### options

SSH connection setup configuration (manual or semi-automatic).

## One of

#### SetupSSHConnectionManual

Type: object
No Additional Properties

##

#### Private Key

SSH private key configuration (new or existing).

## One of

#### KeychainCredentialSetupSSHConnectionKeyNew

Type: object
No Additional Properties

##

#### Generate Key

Type: const Default: true

Indicates a new SSH key pair should be generated.

Specific value: `true`

##

#### Name

Type: string

Name for the new SSH key credential.

Must be at least `1` characters long

#### KeychainCredentialSetupSSHConnectionKeyExisting

Type: object
No Additional Properties

##

#### Generate Key

Type: const Default: false

Indicates an existing SSH key should be used.

Specific value: `false`

##

#### Existing Key Id

Type: integer

ID of the existing SSH private key credential to use.

##

#### Connection Name

Type: string

Name for the SSH connection credential.

Must be at least `1` characters long

##

#### Setup Type

Type: const Default: "MANUAL"

Setup method for the SSH connection.

Specific value: `"MANUAL"`

##

#### SetupSSHConnectionManualSetup

Type: object

Manual SSH connection configuration parameters.

No Additional Properties

##

#### Host

Type: string

SSH server hostname or IP address.

##

#### Port

Type: integer Default: 22

SSH server port number.

##

#### Username

Type: string Default: "root"

SSH username for authentication.

##

#### Remote Host Key

Type: string

Can be discovered with keychaincredential.remotesshhostkeyscan.

##

#### Connect Timeout

Type: integer Default: 10

Connection timeout in seconds for SSH connections.

#### SetupSSHConnectionSemiautomatic

Type: object
No Additional Properties

##

#### Private Key

SSH private key configuration (new or existing).

## One of

#### KeychainCredentialSetupSSHConnectionKeyNew

Type: object
No Additional Properties

##

#### Generate Key

Type: const Default: true

Indicates a new SSH key pair should be generated.

Specific value: `true`

##

#### Name

Type: string

Name for the new SSH key credential.

Must be at least `1` characters long

#### KeychainCredentialSetupSSHConnectionKeyExisting

Type: object
No Additional Properties

##

#### Generate Key

Type: const Default: false

Indicates an existing SSH key should be used.

Specific value: `false`

##

#### Existing Key Id

Type: integer

ID of the existing SSH private key credential to use.

##

#### Connection Name

Type: string

Name for the SSH connection credential.

Must be at least `1` characters long

##

#### Setup Type

Type: const Default: "SEMI-AUTOMATIC"

Setup method for the SSH connection.

Specific value: `"SEMI-AUTOMATIC"`

##

#### KeychainCredentialSetupSSHConnectionSemiAutomaticSetup

Type: object

Semi-automatic SSH connection configuration parameters.

No Additional Properties

##

#### Url

Type: string Format: uri

URL of the remote TrueNAS system for semi-automatic setup.

Must be at least `1` characters long

Must be at most `2083` characters long

##

#### Verify Ssl

Type: boolean Default: true

Whether to verify SSL certificates when connecting to the remote system.

##

#### Token

Default: null

API token for authentication with the remote system or `null`.

## Any of

Type: string
Type: null

##

#### Admin Username

Type: string Default: "root"

Administrative username for the remote system.

##

#### Password

Default: null

Password for the administrative user or `null`.

## Any of

Type: string
Type: null

##

#### Otp Token

Default: null

One-time password token for 2FA authentication or `null`.

## Any of

Type: string
Type: null

##

#### Username

Type: string Default: "root"

Username for the SSH connection.

##

#### Connect Timeout

Type: integer Default: 10

SSH connection timeout in seconds.

##

#### Sudo

Type: boolean Default: false

Whether the SSH user should use sudo for elevated privileges.

##

#### SSHCredentialsEntry

Type: object

The created SSH connection credential.

No Additional Properties

##

#### Id

Type: integer

Unique identifier for this keychain credential.

##

#### Name

Type: string

Distinguishes this Keychain Credential from others.

Must be at least `1` characters long

##

#### Type

Type: const

Keychain credential type identifier for SSH connection credentials.

Specific value: `"SSH_CREDENTIALS"`

##

#### Attributes

Type: object

SSH connection attributes including host, authentication, and connection settings.

No Additional Properties

##

#### Host

Type: string

SSH server hostname or IP address.

##

#### Port

Type: integer Default: 22

SSH server port number.

##

#### Username

Type: string Default: "root"

SSH username for authentication.

##

#### Private Key

Type: integer

Keychain Credential ID.

##

#### Remote Host Key

Type: string

Can be discovered with keychaincredential.remotesshhostkeyscan.

##

#### Connect Timeout

Type: integer Default: 10

Connection timeout in seconds for SSH connections.

Required roles: KEYCHAIN_CREDENTIAL_WRITE