Skip to content

SSH users

List and manage SSH users on an app.

List SSH users on an app, then update authentication settings for one user.

List SSH users

Pass the app ID and an optional limit. Use users.data to pick a user to update.

manageAppSshUsers.jsssh_users.py
const users = await client.apps.ssh.users.list({
  app: "da_XYZ",
  limit: 10,
});
// Should return: { "data": [ { "id": "ssh_user_abc", "username": "u123", ... } ], "hasMore": false }
console.log(users.data);
users = client.apps.ssh.users.list(app="da_XYZ", limit=10)
print(users.data)

Update a user

Set authenticationMethods / authentication_methods to PASSWORD, PUBLIC_KEY, or both.

manageAppSshUsers.jsssh_users.py
const user = users.data[0];
const updated = await client.apps.ssh.users.update(user.id, {
  authenticationMethods: ["PASSWORD", "PUBLIC_KEY"], // options: "PASSWORD", "PUBLIC_KEY", or both
});
// Should return: {
console.log(updated.username, updated.serverHost, updated.port);
user = users.data[0]
updated = client.apps.ssh.users.update(
    user.id,
    authentication_methods=["PASSWORD", "PUBLIC_KEY"],  # options: "PASSWORD", "PUBLIC_KEY", or both
)
# Should return: {
print(updated.username, updated.server_host, updated.port)

Source: stackmachine/sdks examples.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close