Skip to main content

Update an SSH user

PATCH/v2/ssh-users/{sshUserId}
API version
v2
Request method
PATCH
Operation ID
ssh-user-update-ssh-user

Request​

  • sshUserIdstringrequired

    ID of the SSHUser to be updated.

Responses​

No response content specified.

Usage examples​

$ curl \
--fail \
--location \
-X PATCH \
-d '{"active":true,"description":"string","expiresAt":"1985-10-26T01:21:00.000Z","password":"string","publicKeys":[{"comment":"string","key":"string"}]}' \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
-H 'Content-Type: application/json' \
https://api.mittwald.de/v2/ssh-users/string
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";

const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.sshsftpUser.sshUserUpdateSshUser({
"sshUserId": "string",
"data": {
"active": true,
"description": "string",
"expiresAt": "1985-10-26T01:21:00.000Z",
"password": "string",
"publicKeys": [
{
"comment": "string",
"key": "string"
}
]
}
});

assertStatus(response, 204);

use \Mittwald\ApiClient\Generated\V2\Clients\SSHSFTPUser\SshUserUpdateSshUser\SshUserUpdateSshUserRequest;
use \Mittwald\ApiClient\Generated\V2\Clients\SSHSFTPUser\SshUserUpdateSshUser\SshUserUpdateSshUserRequestBody;

$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));

// TODO: Please consult the properties and constructor signature of
// SshUserUpdateSshUserRequestBody to learn how to construct a valid instance
$body = new SshUserUpdateSshUserRequestBody(/* TODO: ... */);

$request = (new SshUserUpdateSshUserRequest(
sshUserId: "string",
body: $body
));
$response = $client->sshsftpUser()->sshUserUpdateSshUser($request);

var_dump($response->getBody();

On this page