Manage a member's CLI devices
See the devices a person signs in to the CLI with and their CLI sessions in your organization, block a device here, and end a session.
A member's device keys (Touch ID, a security key, Windows Hello) belong to them and work in every organization they belong to. As an administrator you act for your organization only: blocking a device stops it signing in here and ends its CLI sessions here, and it keeps working in the person's other organizations. Only the member removes a device (see End CLI sessions).
An IAM user with console access belongs to your organization alone. Their devices are removed, with every CLI session they opened, when you set a new password for them, turn their console access off or delete it, or remove their second factors (see Manage console access).
Replace user-id with the person's IAM user id from dcloud iam users list, and
key-id and session-id with ids from dcloud iam users cli-access.
Prerequisites
iam:ListUserSessionson the person's IAM user to see their devices and sessions. Without it, the Command line tab shows Access denied and names the action.iam:BlockUserDeviceKeyto block a device,iam:UnblockUserDeviceKeyto unblock one, andiam:RevokeUserSessionsto end a session, each on the person's IAM user. Without one, its button is shown but cannot be chosen.- In the console, also
iam:GetUseron the IAM user to open its page (without it the page is not found), andiam:ListUsersto open Users. - The IAM user is a person: a member, or an IAM user with console access. A service account has no
CLI devices or sessions: its page has no Command line tab, and the API answers 404
Not foundfor one. The tab is also missing for a member who was removed from the organization. - Blocking, unblocking and ending a session are IAM changes. From a CLI session that confirms sensitive commands, the CLI asks for a confirmation when your last one is more than five minutes old (see Confirm sensitive CLI commands).
See a person's devices and sessions
- Open Identity, choose Users, then choose the person's IAM user.
- Choose Command line.
Under Devices, each device is listed with its name, its key type as the device reported it (Touch ID, Security key, Windows Hello or Software key), Blocked when your organization blocked it, when it was enrolled and when it was last used. Under Command line sessions in this organization, each session is listed with the device's name, how it signed in (Signed in on this device, confirmed, Signed in with the device key (not confirmed), Signed in in the browser with a passkey or Signed in in the browser without a passkey), when it ends and the address it was last used from.
dcloud iam users cli-access user-idGET /iam/api/users/user-id/cliThe answer lists deviceKeys, each with blocked saying whether your organization blocked it, and
sessions, the person's live CLI sessions in your organization only.
Block a device in your organization
- On the person's Command line tab, choose Block in this organization beside the device.
- Choose Block device.
The console says how many sessions were ended, and the device shows Blocked.
dcloud iam users block-device-key user-id key-idPOST /iam/api/users/user-id/cli/device-keys/key-id/blockThe answer says how many of the device's CLI sessions in your organization were ended
(sessionsEnded). From now on, signing in to your organization with that device is refused with
403 and the code DEVICE_KEY_BLOCKED
(An administrator of … blocked this device for the organization. Sign in another way, or ask them to unblock it.),
and the device cannot confirm sensitive commands here. The person can still sign in to your
organization in the browser, and with the device in their other organizations. The block holds for
that device only: a device the person enrols later is not blocked. Blocking a device that is already
blocked succeeds again. A device that is not one of the person's enrolled devices answers 404
Not found.
Unblock a device
- On the person's Command line tab, choose Unblock beside the device.
The console says the device can sign in here again.
dcloud iam users unblock-device-key user-id key-idDELETE /iam/api/users/user-id/cli/device-keys/key-id/blockSessions the block ended stay ended. A device that is not blocked in your organization answers
404 Not found.
End a session
- On the person's Command line tab, under Command line sessions in this organization, choose Sign out beside the session.
The console says Session ended.
dcloud iam users end-cli-session user-id session-idDELETE /iam/api/users/user-id/cli/sessions/session-idThe session stops working at its next request. Its device stays enrolled and unblocked, so the
person can sign in again; on an enrolled device, the CLI asks for its prompt itself when the next
command runs in a terminal. A session that is not one of the person's live CLI
sessions in your organization, an ended one included, answers 404 Not found.
Related
- Manage members: signing a member out everywhere also blocks every device of theirs in your organization.
- End CLI sessions
- Require Touch ID or a passkey for the CLI
GET /iam/api/users/{id}/cli·dcloud iam users block-device-key