---
title: "Change a Cube's SSH port"
method: PUT
path: "/spaces/{spaceId}/cubes/{cubeId}/ssh-port"
tags: ["Cubes"]
---

# Change a Cube's SSH port

`PUT /spaces/{spaceId}/cubes/{cubeId}/ssh-port`

## Request

- Base URL: `https://krova.cloud/api/v1`
- URL: `https://krova.cloud/api/v1/spaces/{spaceId}/cubes/{cubeId}/ssh-port`
- Auth: API key in header `X-API-KEY`

Sets the port INSIDE the Cube that SSH is forwarded to — NOT the host port you connect to. The host port is allocated by Krova and is unchanged by this call. Pointing this at a port nothing is listening on inside the Cube will make SSH unreachable; the default is 22. The change is applied atomically (the old port mapping is replaced).

## Path parameters

- `spaceId` string, required
- `cubeId` string, required

## Request body

- object
  - `cubePort` integer, required: The port inside the Cube that sshd listens on (default 22). This is the Cube side of the mapping, not the host port.

## Response `200`

SSH port updated

## Other responses

- `400`: Bad request
- `404`: Resource not found
- `409`: Refused because the change conflicts with the Cube's current state, for example the port is already in use or the mapping is already being removed. One such conflict is temporary: in the last stretch of a move of the Cube to another server the change is refused with the error "This cube is being moved to another server. Try again in a minute." Nothing was changed then, and the same request is accepted once the move ends.
- `429`: Rate limit exceeded (10 mutations / 60s)

---

[API](https://skmtc.dev/krova/apis/krova-cloud-api.md) · [All operations](https://skmtc.dev/krova/apis/krova-cloud-api/llms.txt) · [OpenAPI document](https://skmtc.dev/krova/apis/krova-cloud-api/revisions/46bb68281ce1?raw)
