Skip to content

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

idstringrequired
The VPS ID (vps_…).

Example

GET /api/v2/vps/{id}/ssh-password-login
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."
}
}
}
Response fields
availableboolean
True when the setting was read from the running VPS.
enabledboolean or null
True when root can log in over SSH with a password. Null when the setting could not be read or is unclear.
reasonstring or null
Why the setting could not be read, as a sentence you can show. Null when it was read.
passwordAuthenticationstring or null
The PasswordAuthentication value in the SSH server configuration, in lower case.
permitRootLoginstring or null
The PermitRootLogin value in the SSH server configuration, in lower case.
sourcestring
Where 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.
sshKeysConfiguredboolean
True when SSH keys are stored on the VPS service.
sshKeysarray of string
Public 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.
actionsobject
What the caller can do now.
canEnableobject
Whether turning password login on makes sense now. False when it is already on or the setting cannot be read.
allowedboolean
reasonstring or null
codestring or null
A machine-readable code for why the action is blocked.
canDisableobject
Whether turning password login off makes sense now. False when it is already off or the setting cannot be read.
allowedboolean
reasonstring or null
codestring or null
A 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.

400Invalid request. The response body is an RFC 7807 Problem Details document.
401Unauthorized. Authentication is required.
403Forbidden. The caller lacks a required scope or does not own the resource.
404Not found. The resource does not exist or is not owned by the caller; code is vps_not_found.
429Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers.
500Internal error. Retry later or contact support if the issue persists.
502Upstream failure. A dependent provider request failed; the Problem Details code is upstream_failed. Retry later or contact support if the issue persists.