08-22-2022 05:04 AM - edited 08-22-2022 12:16 PM
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.
Solved! Go to Solution.
08-25-2022 08:20 PM
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"
}'
08-23-2022 09:56 PM
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
08-25-2022 02:14 AM
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?
08-25-2022 08:20 PM
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"
}'
New to the site? Take a look at these additional resources:
Ready to join us? You can register here.