Create SSH user for a web hosting package
A new SSH user for one web hosting package, with its public keys - after the customer agreed to the AGB and the rules for SSH users.
manitu_webhosting_web_sshuser_create on https://mcp.manitu.de/mcpAnnotations as tools/list sends them
Description for the model
Creates an SSH user for a web hosting package of the manitu customer account this connection works in, by its site_id from manitu_webhosting_list. Login is by public key only: give ssh_key_list (the customer's public keys) or ssh_keys_same_as (the username of another SSH user of the package whose keys it gets). manitu gives the user name (ssh<number>); the answer has it and how to connect. CONSENT IN TWO CALLS: the first call (without consent_token) is answered with the conflict consent_required - its consent_list holds what the customer has to agree to (the AGB as a link, the rules for SSH users as a text) and a consent_token. Show the customer every item of it - the title with the link, the text as it is, in its language (language; it is the binding wording - a translation only in addition, marked as an unofficial help) - and ask for an explicit yes. Only then make the same call again with consent_token (valid 15 minutes, once). Never agree on the customer's behalf. Also refused with a conflict when the package allows no more SSH users (limit_reached), its disk space is almost full (quota_almost_exceeded) or it cannot be changed now (not_configurable). An SSH user reaches the whole package.
Provide at least one of: ssh_key_list, ssh_keys_same_as.
Arguments
site_idinteger | stringrequiredThe site_id from manitu_webhosting_list - never guess one.
quota_mbinteger | nullDisk space in MB the files it owns may take, at most the package's; null or 0: no limit of its own.
statusstringactive, or inactive to switch it off without deleting it. Default when created: active.
expires_atstring | nullWhen the SSH user expires - it works up to the next midnight (Europe/Berlin) at or after the moment given, which the answer shows. Not in the past. From this moment on it can no longer be used (the moment itself is excluded); null: without end.
descriptionstring | nullThe customer's description, for his own overview - e.g. who uses it. Left out: unchanged (set) or none (create); null or empty: none.
ssh_key_listarray of stringThe public keys that may log in as this SSH user - all of them: the list replaces the keys it has. Only one of ssh_key_list, ssh_keys_same_as. Each one public key, one line as in authorized_keys: "ssh-ed25519 AAAA... comment" (also ecdsa-sha2-nistp256/384/521, ssh-rsa from 2048 bits). No options in front of the key (command=, environment=, from= ...), no DSA. The public key only - never a private key.
ssh_keys_same_asstringThe user name of the SSH user (ssh<number>) from manitu_webhosting_web_sshuser_list - never guess one.
shellstringbash (default when created), zsh, or git - git-shell: only git push/pull, no commands.
consent_tokenstringwrite-onlyThe consent_token from the consent_required answer of the same call - only after the customer agreed to everything in its consent_list. Valid 15 minutes, once.
Result structuredContent, checked against the schema
usernamestringrequiredThe user name to log in with (ssh<number>) - what the other SSH user tools take.
descriptionstring | nullrequiredWhat the customer wrote about it (his description), null if nothing - not its name or user name.
statusstringrequiredactive, or inactive (switched off by the customer, kept for later).
is_usable_nowbooleanrequiredIt can log in right now: active and not expired.
expires_atstring | nullrequiredWhen the SSH user expires. From this moment on it can no longer be used (the moment itself is excluded); null: without end.
shellstring | nullrequiredThe shell: bash, zsh, or git (git only - for pushing and pulling repositories).
quota_mbinteger | nullrequiredDisk space in MB the files it owns may take; null: no limit of its own (the package's applies).
created_atstring | nullrequiredWhen it was created.
last_login_atstring | nullrequiredIts last login, null if never.
ssh_key_listarray of object | nullrequiredThe public keys that may log in, read live from the server (the customer may change them there himself); null if the file could not be read.
ssh_key_list[].linestringrequiredThe line as it is in the file - a public key, no secret.
ssh_key_list[].algorithmstring | nullrequirede.g. ssh-ed25519; null if the line is no key.
ssh_key_list[].commentstring | nullrequiredThe comment after the key - often who it belongs to.
ssh_key_list[].fingerprint_sha256string | nullrequiredAs "ssh-keygen -lf" shows it, e.g. "SHA256:...".
ssh_key_list[].has_optionsbooleanrequiredOptions in front of the key (command=, from= ...) - written by the customer on the server.
ssh_key_list[].is_validbooleanrequiredA line manitu would write itself; false: kept only as long as the file is not replaced.
connectionobjectrequiredconnection.hoststring | nullrequiredThe host to connect to - the web server of the package.
connection.usernamestringrequiredThe user name to log in with.
connection.method_listarray of objectrequiredThe ways to connect: SSH on port 22.
connection.method_list[].protocolstringrequiredconnection.method_list[].portintegerrequiredconnection.method_list[].is_encryptedbooleanrequiredconnection.method_list[].is_recommendedbooleanrequiredconnection.authstringrequiredpublic_key_only: log in with a key from the user's ssh_key_list - a password does not work.
connection.host_key_listarray of objectrequiredThe server's host keys - on the first connection the SSH client shows one of these fingerprints; it must match.
connection.host_key_list[].algorithmstringrequiredconnection.host_key_list[].fingerprint_sha256stringrequiredAs the SSH client shows it, e.g. "SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8".
Authentication
One of X-API-Key, Authorization: Bearer … - never more than one in a request. More
Request body JSON; unknown fields are refused
site_idinteger | stringrequiredThe site_id from manitu_webhosting_list - never guess one.
quota_mbinteger | nullDisk space in MB the files it owns may take, at most the package's; null or 0: no limit of its own.
statusstringactive, or inactive to switch it off without deleting it. Default when created: active.
expires_atstring | nullWhen the SSH user expires - it works up to the next midnight (Europe/Berlin) at or after the moment given, which the answer shows. Not in the past. From this moment on it can no longer be used (the moment itself is excluded); null: without end.
descriptionstring | nullThe customer's description, for his own overview - e.g. who uses it. Left out: unchanged (set) or none (create); null or empty: none.
ssh_key_listarray of stringThe public keys that may log in as this SSH user - all of them: the list replaces the keys it has. Only one of ssh_key_list, ssh_keys_same_as. Each one public key, one line as in authorized_keys: "ssh-ed25519 AAAA... comment" (also ecdsa-sha2-nistp256/384/521, ssh-rsa from 2048 bits). No options in front of the key (command=, environment=, from= ...), no DSA. The public key only - never a private key.
ssh_keys_same_asstringThe user name of the SSH user (ssh<number>) from manitu_webhosting_web_sshuser_list - never guess one.
shellstringbash (default when created), zsh, or git - git-shell: only git push/pull, no commands.
consent_tokenstringwrite-onlyThe consent_token from the consent_required answer of the same call - only after the customer agreed to everything in its consent_list. Valid 15 minutes, once.
Response in data; the rest of the body as on every call
usernamestringrequiredThe user name to log in with (ssh<number>) - what the other SSH user tools take.
descriptionstring | nullrequiredWhat the customer wrote about it (his description), null if nothing - not its name or user name.
statusstringrequiredactive, or inactive (switched off by the customer, kept for later).
is_usable_nowbooleanrequiredIt can log in right now: active and not expired.
expires_atstring | nullrequiredWhen the SSH user expires. From this moment on it can no longer be used (the moment itself is excluded); null: without end.
shellstring | nullrequiredThe shell: bash, zsh, or git (git only - for pushing and pulling repositories).
quota_mbinteger | nullrequiredDisk space in MB the files it owns may take; null: no limit of its own (the package's applies).
created_atstring | nullrequiredWhen it was created.
last_login_atstring | nullrequiredIts last login, null if never.
ssh_key_listarray of object | nullrequiredThe public keys that may log in, read live from the server (the customer may change them there himself); null if the file could not be read.
ssh_key_list[].linestringrequiredThe line as it is in the file - a public key, no secret.
ssh_key_list[].algorithmstring | nullrequirede.g. ssh-ed25519; null if the line is no key.
ssh_key_list[].commentstring | nullrequiredThe comment after the key - often who it belongs to.
ssh_key_list[].fingerprint_sha256string | nullrequiredAs "ssh-keygen -lf" shows it, e.g. "SHA256:...".
ssh_key_list[].has_optionsbooleanrequiredOptions in front of the key (command=, from= ...) - written by the customer on the server.
ssh_key_list[].is_validbooleanrequiredA line manitu would write itself; false: kept only as long as the file is not replaced.
connectionobjectrequiredconnection.hoststring | nullrequiredThe host to connect to - the web server of the package.
connection.usernamestringrequiredThe user name to log in with.
connection.method_listarray of objectrequiredThe ways to connect: SSH on port 22.
connection.method_list[].protocolstringrequiredconnection.method_list[].portintegerrequiredconnection.method_list[].is_encryptedbooleanrequiredconnection.method_list[].is_recommendedbooleanrequiredconnection.authstringrequiredpublic_key_only: log in with a key from the user's ssh_key_list - a password does not work.
connection.host_key_listarray of objectrequiredThe server's host keys - on the first connection the SSH client shows one of these fingerprints; it must match.
connection.host_key_list[].algorithmstringrequiredconnection.host_key_list[].fingerprint_sha256stringrequiredAs the SSH client shows it, e.g. "SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8".
Statuses
200Success.400The request does not match the declared input schema.401No credential was presented, or it was not recognised.403The credential is not permitted to use this operation.500The server failed. Nothing about the request was wrong. Whether a change took effect is not known - check before trying it again.503The channel this operation forwards through is unavailable.