cancel
Showing results for 
Search instead for 
Did you mean: 

A REST API to bind a jumpcloud user with jumpcloud-enabled Linux cloud VM for SSH Access

murtaza1983
Novitiate I

We have a cloud Linux ubuntu VM which has Jumpcloud agent installed. We have a group of jumpcloud users which needs SSH access to this instance. 

The question is: Is there any REST API wherein the above group of Jumpcloud Users can be bind with the cloud VM to enable these users to have SSH access on this instance.

Currently this is done through Admin Portal of Jumpcloud but we want to achieve this via a curl call to REST API.

1 ACCEPTED SOLUTION

Hey

Yes, binding users to systems happens here.
This is covered in the KB about the System Context. 

curl -X POST https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {API_KEY}' \
  -d '{
    "attributes": {
      "sudo": {
        "enabled": true,
        "withoutPassword": false
      }
    },
    "op": "add",
    "type": "user",
    "id": "UserID"
  }'

View solution in original post

3 REPLIES 3

JuergenKlaassen
Rising Star III
Rising Star III

Hi @murtaza1983 

I hope this may get you where you want. (and the respective API Docs where it doesn't seem to be fully documented by now)

 

curl 'https://console.jumpcloud.com/api/v2/usergroups/<USERGROUP_ID>' \
  -X 'PUT' \
  -H 'Accept: application/json, text/plain, */*' \
  -H 'Content-Type: application/json;charset=UTF-8' \
  -H 'X-Org-Id: <ORG ID>' \
  -H 'X-apikey: <API KEY>' \
  --data-raw '{"attributes":{"sudo": { "enabled": true }}}'

 

->  attributes.sudo.enabled flag to true

 

Hi JuergenKlaassen

Thanks for the reply. But I am looking to bind a System with a User or group of Users. Is there any API for doing that?

Hey

Yes, binding users to systems happens here.
This is covered in the KB about the System Context. 

curl -X POST https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {API_KEY}' \
  -d '{
    "attributes": {
      "sudo": {
        "enabled": true,
        "withoutPassword": false
      }
    },
    "op": "add",
    "type": "user",
    "id": "UserID"
  }'