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:

  1. On the location server:
    1. Open the file /etc/sudoers:

      visudo /etc/sudoers
      BASH
    2. Configure superuser permissions for the accounts. To do this, add or edit the %sudo parameter:

      %sudo   ALL=(ALL:ALL) NOPASSWD: ALL
      CODE
  2. Add or edit location settings in the platform via API:
    1. 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"}'
      CODE

      domain.com — domain name or IP address of the server with the platform

      admin_email — platform administrator's email

      admin_pass — platform administrator's password

      In 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"
      }
      CODE

      Save the received token value.

    2. 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 location

      curl -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"
      }'
      CODE

      <auth_token> — authorization token