Read SSH server settings for an app, then list users attached to that server.
Read server settings
Call client.apps.ssh.retrieve with the app ID. Check enabled before connecting users.
getAppSshServer.jsssh_server.py
const sshServer = await client.apps.ssh.retrieve("da_XYZ");
// Should return: {
// "id": "ssh_server_abc",
// "enabled": true
// }
console.log(sshServer.id, sshServer.enabled);server = client.apps.ssh.retrieve("da_XYZ")
# Should return: {
# "id": "ssh_server_abc",
# "enabled": true
# }
print(server.id, server.enabled)List SSH users
List users for the app. Each entry includes username, port, and serverHost / server_host for connections.
getAppSshServer.jsssh_server.py
const users = await client.apps.ssh.users.list({ app: "da_XYZ", limit: 10 });
// Should return: {
// "data": [
// {
// "id": "ssh_user_abc",
// "username": "u123",
// "port": 22,
// "serverHost": "ssh.example.com",
// "sftpRootFolder": "/"
// }
// ],
// "hasMore": false
// }
console.log(users.data);users = client.apps.ssh.users.list(app="da_XYZ", limit=10)
# Should return: {
# "data": [
# { "id": "ssh_user_abc", "username": "u123", "port": 22, "server_host": "ssh.example.com" }
# ],
# "has_more": false
# }
print(users.data)Source: stackmachine/sdks examples.