# SSH Server

SSH target for deploying to remote servers via SSH connection.

## YAML Parameters

```typescript
interface YAMLParameters {
  /** The host for the connection */
  host: string;
  /** The human-readable ID of the target */
  target: string;
  /** The name of the target */
  name?: string;
  /** The port for the connection */
  port?: string;
  /** Path on the server defined in the target */
  path?: string;
  /** Authentication details */
  auth?: SSHAuthYaml;
  /** Define a SSH proxy server using the following parameters */
  proxy?: string | TargetSSHProxyYaml;
  /** Indicates if this target is disabled (default: false) */
  disabled?: boolean;
  /** The list of tags associated with the target */
  tags?: string[];
  /** The permissions for the target */
  permissions?: PermissionsYaml;
  /** Defines how the target can be used (as deployment target, proxy, or both) */
  use_as?: UseAsYaml;
  /** Note for this resource */
  note?: string;
  /** YAML note for AI agents operating on this resource */
  agent_note?: string;
  type?: "SSH";
}
```

## Type Definitions

```typescript
interface SSHAuthYaml {
  /** Authentication method */
  method?: "PASSWORD" | "SSH_KEY" | "ASSETS_KEY" | "PROXY_CREDENTIALS" | "PROXY_KEY";
  /** The username required to connect to the server */
  username?: string;
  /** The password required to connect to the server. Required for PASSWORD method */
  password?: string;
  /** Name of the variable containing the private key. Required for ASSETS_KEY method */
  asset?: string;
  /** Passphrase for the SSH key */
  passphrase?: string;
  /** The private SSH key. Required when method is SSH_KEY */
  key?: string;
  /** Path to the key on proxy server. Required for method PROXY_KEY */
  key_path?: string;
}

interface TargetSSHProxyYaml {
  /** Name of the proxy server */
  name?: string;
  /** Host for the proxy connection */
  host?: string;
  /** The port for the proxy connection */
  port?: string;
  /** Define proxy servers' authentication method using the following parameters */
  auth?: SSHAuthYaml;
}

interface PermissionsYaml {
  /** Access level for other workspace members */
  others?: "DENIED" | "READ_ONLY" | "USE_ONLY" | "BLIND" | "RUN_ONLY" | "READ_WRITE" | "MANAGE" | "DEFAULT" | "ALLOWED" | "STAGE" | "COMMIT";
  /** List of specific users with their access levels */
  users?: object;
  /** List of user groups with their access levels */
  groups?: object;
  /** List of pipelines allowed to access this resource */
  pipelines?: AllowedPipelineYaml[];
  /** List of sandboxes allowed to access this resource */
  sandboxes?: AllowedSandboxYaml[];
}

interface AllowedPipelineYaml {
  /** When true, allow all pipelines to access this resource */
  all?: "DENIED" | "READ_ONLY" | "USE_ONLY" | "BLIND" | "RUN_ONLY" | "READ_WRITE" | "MANAGE" | "DEFAULT" | "ALLOWED" | "STAGE" | "COMMIT";
  /** Project name containing the allowed pipeline */
  project?: string;
  /** Pipeline identifier that is allowed to access this resource */
  pipeline?: string;
  /** Access level granted to the pipeline */
  access?: "DENIED" | "READ_ONLY" | "USE_ONLY" | "BLIND" | "RUN_ONLY" | "READ_WRITE" | "MANAGE" | "DEFAULT" | "ALLOWED" | "STAGE" | "COMMIT";
}

interface AllowedSandboxYaml {
  /** When true, allow all sandboxes to access this resource */
  all?: "DENIED" | "READ_ONLY" | "USE_ONLY" | "BLIND" | "RUN_ONLY" | "READ_WRITE" | "MANAGE" | "DEFAULT" | "ALLOWED" | "STAGE" | "COMMIT";
  /** Project name containing the allowed sandbox */
  project?: string;
  /** Sandbox identifier that is allowed to access this resource */
  sandbox?: string;
  /** Access level granted to the sandbox */
  access?: "DENIED" | "READ_ONLY" | "USE_ONLY" | "BLIND" | "RUN_ONLY" | "READ_WRITE" | "MANAGE" | "DEFAULT" | "ALLOWED" | "STAGE" | "COMMIT";
}

interface UseAsYaml {
  /** Whether the target can be used as a deployment target (default: on) */
  target?: boolean | "on" | "off";
  /** Whether the target can be used as a proxy (default: on) */
  proxy?: boolean | "on" | "off";
}

```

## YAML Examples

### SSH target with password authentication and proxy

```yaml
- target: my_ssh_target_action
  type: SSH
  name: name
  host: ubuntu.tests
  path: /path
  auth:
    method: PASSWORD
    username: buddy
    password: $password
  proxy: my_ssh_2
  tags:
    - tag1

```

### With Proxy Inline

```yaml
- target: ssh_with_proxy_inline
  type: SSH
  name: name
  host: ubuntu.tests
  auth:
    method: PASSWORD
    username: buddy
    password: $password
  proxy:
    host: ubuntu.tests
    auth:
      method: PASSWORD
      username: buddy
      password: $password

```

### With Permissions

```yaml
- target: ubuntu_project
  type: SSH
  host: ubuntu.testss
  auth:
    method: "PASSWORD"
    username: buddy
    password: secure!+EeFMrybg4nNIbPaNi51dg==.9aJZfUp7fN1FjqgGWwQKlA==
  permissions:
    others: USE_ONLY
    users:
      user@gmail.com: MANAGE
    pipelines:
      - all: READ_WRITE
      - project: sroda
        pipeline: dsadsa123
      - project: sroda
        pipeline: dsadsa

```


---
Original source: https://buddy.works/docs/yaml/yaml-targets/ssh