Change SSH user of a web hosting package
Change keys, shell, disk space, status, end or description of one SSH user.
manitu_webhosting_web_sshuser_set on https://mcp.manitu.de/mcpAnnotations as tools/list sends them
Description for the model
Changes an SSH user of a web hosting package of the manitu customer account this connection works in, by site_id and username from manitu_webhosting_web_sshuser_list. Only the fields given change. Keys: ssh_key_list REPLACES all keys - to add one, read the keys with manitu_webhosting_web_sshuser_get and send the old ones plus the new one; or ssh_keys_same_as copies another SSH user's keys. If the customer wrote lines on the server that would be lost (options like command= or from=), the call is refused with the conflict ssh_keys_would_be_lost and those lines - tell the customer, and only with his yes send it again with replace_all true. status inactive switches it off without deleting it and ends its open sessions; expires_at null removes the end. Refused with a conflict when the package cannot be changed now (not_configurable). Tell the customer what will change and ask for an explicit yes first.
Arguments
site_idinteger | stringrequiredThe site_id from manitu_webhosting_list - never guess one.
usernamestringrequiredThe user name of the SSH user (ssh<number>) from manitu_webhosting_web_sshuser_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.
replace_allbooleantrue: replace the keys even if lines the customer wrote on the server are lost (after ssh_keys_would_be_lost, with the customer's yes). Default false.
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.
usernamestringrequiredThe user name of the SSH user (ssh<number>) from manitu_webhosting_web_sshuser_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.
replace_allbooleantrue: replace the keys even if lines the customer wrote on the server are lost (after ssh_keys_would_be_lost, with the customer's yes). Default false.
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.