Skip to content
Pre-release. HostCraft is in testing and not yet for sale. These docs describe the current build and may change. Join the waitlist to hear when it launches.

SSH API

Source: daemon/proto/hostcraft/v1/ssh.proto

SSHService manages an account's SFTP access and authorized keys. REST: /api/v1/accounts/{account_id}/ssh-keys and /ssh-access.

Method REST route Permission Streaming
GetSSHState GET /api/v1/accounts/{account_id}/ssh-keys SSHKeyRead unary
AddSSHKey POST /api/v1/accounts/{account_id}/ssh-keys SSHKeyCreate unary
ImportSSHKeys POST /api/v1/accounts/{account_id}/ssh-keys/import SSHKeyCreate unary
RemoveSSHKey DELETE /api/v1/accounts/{account_id}/ssh-keys/{fingerprint} SSHKeyDelete unary
SetSSHAccess PATCH /api/v1/accounts/{account_id}/ssh-access SSHAccessUpdate unary

/hostcraft.v1.SSHService/GetSSHState

/hostcraft.v1.SSHService/AddSSHKey

ImportSSHKeys adds every valid key from an authorized_keys file.

/hostcraft.v1.SSHService/ImportSSHKeys

/hostcraft.v1.SSHService/RemoveSSHKey

/hostcraft.v1.SSHService/SetSSHAccess

Field Type Number Description
account_id string 1 -
public_key string 2 -

Empty is returned by RPCs whose REST route answers with an empty object or 204 No Content.

No fields.

Field Type Number Description
account_id string 1 -
Field Type Number Description
account_id string 1 -
authorized_keys string 2 -
Field Type Number Description
account_id string 1 -
fingerprint string 2 -
Field Type Number Description
managed bool 1 -
enabled bool 2 -
suspended bool 3 -
username string 4 -
host string 5 -
port int64 6 -
mode string 7 sftp
Field Type Number Description
fingerprint string 1 -
sha256 string 2 -
type string 3 -
comment string 4 -
public_key string 5 -
added_at google.protobuf.Timestamp 6 -

SSHState is the account's keys and access; ImportSSHKeys also reports how many keys were added and which lines were invalid.

Field Type Number Description
keys repeated SSHKey 1 -
access SSHAccess 2 -
added int64 3 -
invalid int64 4 lines that were not valid keys
Field Type Number Description
account_id string 1 -
enabled optional bool 2 -