Check SSH password login on a VPS
GET /api/v2/vps/{id}/ssh-password-login
Reads from the running VPS whether root can log in over SSH with a password. The check runs a short command through the guest agent and can take a few seconds. Call it when you need the answer, not on every page load. When the VPS is stopped, still being set up or has no working guest agent, available is false and reason says why. Turn it on or off with PATCH /api/v2/vps/{id}/ssh-password-login.
Authentication: An API key with the scope read:vm. About keys and scopes
Request
Path parameters
idstringrequiredThe VPS ID (
vps_…).Example
curl "https://cloud.hostup.se/api/v2/vps/vps_01hxa3b4c5d6e7f8g9h0j1k2m3/ssh-password-login" \ -H "Authorization: Bearer $HOSTUP_API_KEY"Responses
200 The SSH password login setting or the reason it could not be read.
{ "available": true, "enabled": false, "reason": null, "passwordAuthentication": "no", "permitRootLogin": "prohibit-password", "source": "effective_sshd_config", "sshKeysConfigured": true, "sshKeys": [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE9wZW5BUElFeGFtcGxlS2V5TWF0ZXJpYWwxMjM0 alex@example.com" ], "actions": { "canEnable": { "allowed": true, "reason": null }, "canDisable": { "allowed": false, "reason": "SSH password login is already disabled." } }}{ "available": false, "enabled": null, "reason": "Start the VPS before checking SSH password login.", "passwordAuthentication": null, "permitRootLogin": null, "source": "unavailable", "sshKeysConfigured": true, "sshKeys": [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE9wZW5BUElFeGFtcGxlS2V5TWF0ZXJpYWwxMjM0 alex@example.com" ], "actions": { "canEnable": { "allowed": false, "reason": "Start the VPS before checking SSH password login." }, "canDisable": { "allowed": false, "reason": "Start the VPS before checking SSH password login." } }}{ "available": false, "enabled": null, "reason": "VPS provisioning is not complete. SSH password login can be checked once setup finishes.", "passwordAuthentication": null, "permitRootLogin": null, "source": "unavailable", "sshKeysConfigured": false, "sshKeys": [], "actions": { "canEnable": { "allowed": false, "reason": "VPS provisioning is not complete. SSH password login can be checked once setup finishes." }, "canDisable": { "allowed": false, "reason": "VPS provisioning is not complete. SSH password login can be checked once setup finishes." } }}Response fields
availablebooleanTrue when the setting was read from the running VPS.
enabledboolean or nullTrue when root can log in over SSH with a password. Null when the setting could not be read or is unclear.
reasonstring or nullWhy the setting could not be read, as a sentence you can show. Null when it was read.
passwordAuthenticationstring or nullThe
PasswordAuthentication value in the SSH server configuration, in lower case.permitRootLoginstring or nullThe
PermitRootLogin value in the SSH server configuration, in lower case.sourcestringWhere the values come from.
effective_sshd_config: the running SSH server. config_files: the configuration files. unavailable: nothing could be read. One of effective_sshd_config, config_files, unavailable, unknown.sshKeysConfiguredbooleanTrue when SSH keys are stored on the VPS service.
sshKeysarray of stringPublic SSH keys stored on the VPS service, the ones installed at setup or rebuild.
GET /api/v2/vps/{id}/ssh-access shows the keys that can log in now.actionsobjectWhat the caller can do now.
canEnableobjectWhether turning password login on makes sense now. False when it is already on or the setting cannot be read.
allowedbooleanreasonstring or nullcodestring or nullA machine-readable code for why the action is blocked.
canDisableobjectWhether turning password login off makes sense now. False when it is already off or the setting cannot be read.
allowedbooleanreasonstring or nullcodestring or nullA machine-readable code for why the action is blocked.
Errors
Errors are Problem Details with a stable code. Branch on the code, not on the text.
| 400 | Invalid request. The response body is an RFC 7807 Problem Details document. |
| 401 | Unauthorized. Authentication is required. |
| 403 | Forbidden. The caller lacks a required scope or does not own the resource. |
| 404 | Not found. The resource does not exist or is not owned by the caller; code is vps_not_found. |
| 429 | Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers. |
| 500 | Internal error. Retry later or contact support if the issue persists. |
| 502 | Upstream failure. A dependent provider request failed; the Problem Details code is upstream_failed. Retry later or contact support if the issue persists. |