If security policies prohibit connecting to the location through the root user, you can set up a connection through another account. This account must have superuser permissions.
To configure a connection to the location:
- On the location server:
-
Open the file /etc/sudoers:
visudo /etc/sudoers
-
Configure superuser permissions for the accounts. To do this, add or edit the %sudo parameter:
%sudo ALL=(ALL:ALL) NOPASSWD: ALL
-
- Add or edit location settings in the platform via API:
- Get the authorization token.
curl -k -X POST -H "accept: application/json" -H "Content-Type: application/json" 'https://domain.com/auth/v4/public/token' -d '{"email": "admin_email", "password": "admin_pass"}'
Comments to the commandIn response, you will get the message in the form:
Example of response in JSON{ "confirmed": true, "expires_at": null, "id": "6", "token": "4-e9726dd9-61d9-2940-add3-914851d2cb8a" }
Save the received token value.
-
Run an API request to add or edit location settings. You can use the curl utility or the Swagger interactive shell. In the ssh_user parameter, specify the username for connection:
Example of a request to add a locationcurl -k -X 'POST' \ 'https://domain.com/dci/v3/location' \ -H "x-xsrf-token: <auth_token>" \ -H "isp-box-instance: true" \ -d '{ "name": "My Location", "password": "secret", "ssh_address": "192.0.2.1", "ssh_port": 22, "ssh_user": "username" }'
Comments
- Get the authorization token.