Skip to main content

Use managed SSH on a VM

Use managed SSH to open a named Linux session in the Kube-DC console or connect with an approved SSH credential. On Kube-DC Cloud and self-hosted installations, availability depends on your Organization and Project. For an existing VM, open Access and check for Managed SSH enabled.

Create a managed VM with a persistent disk​

You need current Project membership and permission to create VMs and persistent volume claims. The VM wizard offers managed SSH for supported images when your Project has an approved root snapshot.

  1. Open Virtual machines and click Create virtual machine.
  2. Select an operating system. When your Project has an approved managed image, the wizard checks Enable managed SSH and shows Approved managed snapshot as the image source.
  3. Set CPU, memory, and root disk capacity. Use the storage class and minimum size shown for the selected image. Keep automatic Project networking and start the VM on creation so the guest can enroll.
  4. Submit the request. Use Check progress to resume the same request until the guest applies its SSH policy. Open the VM and confirm that Access shows Managed SSH enabled.

The platform enrolls the creator as the first SSH administrator. Use the methods shown in Connect after enrollment.

The root disk and its files survive a restart. Use the VM configuration controls to edit CPU, memory, and shutdown grace when your Project role permits the change. The readiness timing controls appear when the VM has a readiness probe. You can expand the root disk on an expandable storage class. After expanding, check whether your guest operating system needs to grow its partition or filesystem to use the new capacity. Review the root disk and data removal before deleting the VM.

Create an ephemeral pilot VM​

You need an Organization administrator account, access to the selected Project, and permission to create VMs in it. Check that the Project has enough CPU and memory for the guest and its launcher.

  1. Select the Project and open Virtual machines.
  2. Click Create ephemeral VM. Select an image from the sheet and set the name, CPU, and memory.
  3. Click Request VM. Select Check progress until enrollment finishes. You can reopen the request in the same browser tab.
  4. Select Open VM access and confirm that Managed SSH enabled appears.

The ephemeral boot disk loses its changes when KubeVirt replaces the VM instance. Use the persistent creation flow for a workload that needs a root disk across restarts. Standard VM creation

Open a browser terminal​

  1. Sign in with your Organization account and select the VM's Project.
  2. Open the running VM and select Connect.
  3. Click Open SSH terminal. Run id -un and compare the result with the Linux username shown under Browser SSH.

If the terminal button is unavailable, confirm the VM is running and check whether your VM grant includes Browser SSH. Ask a VM access administrator to review your effective grant if the method remains unavailable.

Connect with a personal key​

You need an approved Public key grant on the VM and a workstation that can reach an address shown in Connect.

  1. Open Account > SSH keys and select Add public key. Paste an OpenSSH public key or select its .pub file. Keep the private key on your workstation.
  2. Open the VM, select Access > Attach key, and choose the registered key. Registration makes the key available in your Organization. Attaching it applies the key to the selected VM.
  3. Open Connect. Under From your computer, copy the command for a reachable address. Use your matching local private key, adding -i PATH_TO_PRIVATE_KEY if OpenSSH needs to select it explicitly.
  4. Verify the host identity against the SSH host fingerprint shown in Connect. Stop and ask an operator to verify the guest if the fingerprint differs.

A Project network address requires a route to that network. Use the browser terminal or the available CLI certificate relay when you lack that route.

Each person uses their own account and can attach more than one registered key. You can register a replacement, attach and test it, and then detach or retire the old key.

Connect with a CLI certificate​

When Connect displays CLI certificate, install the CLI version offered for your installation and confirm that kube-dc ssh vm --help is available. Install OpenSSH, sign in to the same Organization, and select the Project context. Run the command shown in Connect.

kube-dc ssh vm PROJECT_NAME/VM_NAME --relay

Use the Project name shown in the console for PROJECT_NAME and the VM's name for VM_NAME. If your operator supplies a private CA for the backend, add --backend-ca-cert PATH_TO_CA_BUNDLE. The CLI requests a short-lived SSH certificate and verifies the enrolled guest host key.

Use managed SSH from an MCP client​

Use an MCP session signed in as your own user in the VM's Organization. Check that the server offers vm_ssh. Set request.action to choose an operation. For Project operations, put the console's Project name in top-level project. Read each result in structuredContent.data.

For an existing VM, start with the get-access action.

  1. Call vm_ssh with request.action set to list-images. Pick an entry from items using its catalogOS, storageClass, and minimumGiB.
  2. Set request.action to create and supply name, image, cpu, memoryGi, diskGi, and a new lowercase UUID v4 operationId inside request. Use the approved image alias and at least the image minimum for diskGi.
  3. While phase is pending or enrolling, wait briefly and repeat the identical request with the same operationId. Continue when phase is managed. Keep the returned vmUID when available. If the request is blocked, review its status before submitting another one.
  4. Set request.action to get-access and include name and the vmUID when known. Use the returned vmUID, username, allowed methods, and a reachable address from endpoints. Verify the host key against hostKeyFingerprint and check namedTransportReady before connecting.

This is a vm_ssh creation request. Replace the image alias and generate a new operationId for your VM.

{
"project": "dev",
"request": {
"action": "create",
"name": "analysis-runner",
"image": "APPROVED_IMAGE_ALIAS",
"cpu": 2,
"memoryGi": 4,
"diskGi": 25,
"operationId": "7ac43ebe-2ba1-40fa-9be2-c62c5157475d"
}
}

For a personal key, use list-keys to find your registered key, or register-key with label and the OpenSSH publicKey inside request. Omit project for both Organization-level actions. To attach or detach the key, use attach-key or detach-key with the Project and put name, vmUID, and the registered key's id as keyId inside request. You need a Public key grant to attach a key. The get-access result lists your own key attachments on the VM.

Keep private keys on your workstation. Connect with OpenSSH to a reachable endpoint after verifying its host fingerprint. If the VM offers CLI certificate access, use the CLI certificate procedure with the same Organization identity. vm_ssh never returns relay tickets or guest passwords. The separate create_vm tool creates a Project-key VM.

Grant and remove access​

An Organization administrator can manage SSH grants across the Organization. If you create a persistent VM with managed SSH, you can manage its grants while you retain Project permission to edit the VM and an effective VM administrator SSH grant on it.

  1. As a VM access administrator, open Access > Grant access.
  2. Select an eligible person or group and choose VM user or VM administrator. Select the sign-in methods to permit and set an optional expiry in End access.
  3. Click Save grant. Ask the recipient to sign in and verify that Connect shows the intended method.

To remove access, choose the action that matches your scope.

ActionEffect
Detach a key under AccessStops the key from authorizing fresh logins to this VM.
Retire key under Account > SSH keysStops fresh logins with that key across the Organization.
Remove grant on the VMRemoves the selected grant. Independent direct or inherited grants can still allow SSH.
Block a person on the VMDenies the person's new managed SSH sign-ins to this VM, including through a group grant.
End sessions on the VM, when availableRequests closure of the person's open VM SSH sessions. Their grants can still authorize later sign-ins.
Remove the last qualifying Project membershipRevokes managed SSH in that Project. Registered keys remain available for grants in other Projects.
Remove Organization membershipRevokes managed SSH across the Organization and retires the member's key registrations. A returning member needs current grants and registrations.

Check Revocation progress when the VM shows it. The browser and guest session statuses can progress separately. A detached or retired key can have an existing session. Use the separate session action when you need to close it.