Create an S3 user

To test the gateway, create an S3 user and grant the user access. The man radosgw-admin command provides information on additional command options.

Note: In a multi-site deployment, always create a user on a host in the master zone of the master zone group.

Prerequisites

  • root or sudo access

  • Ceph Object Gateway installed

Procedure

  1. Create an S3 user:

    Syntax

    radosgw-admin user create --uid=name --display-name="USER_NAME"

    Replace name with the name of the S3 user:

    Example

    [root@host01 ~]# radosgw-admin user create --uid="testuser" --display-name="Jane Doe"
    {
        "user_id": "testuser",
        "display_name": "Jane Doe",
        "email": "",
        "suspended": 0,
        "max_buckets": 1000,
        "auid": 0,
        "subusers": [],
        "keys": [
            {
                "user": "testuser",
                "access_key": "CEP28KDIQXBKU4M15PDC",
                "secret_key": "MARoio8HFc8JxhEilES3dKFVj8tV3NOOYymihTLO"
            }
        ],
        "swift_keys": [],
        "caps": [],
        "op_mask": "read, write, delete",
        "default_placement": "",
        "placement_tags": [],
        "bucket_quota": {
            "enabled": false,
            "check_on_raw": false,
            "max_size": -1,
            "max_size_kb": 0,
            "max_objects": -1
        },
        "user_quota": {
            "enabled": false,
            "check_on_raw": false,
            "max_size": -1,
            "max_size_kb": 0,
            "max_objects": -1
        },
        "temp_url_keys": [],
        "type": "rgw"
    }
  2. Verify the output to ensure that the values of access_key and secret_key do not include a JSON escape character (\). These values are needed for access validation, but certain clients cannot handle if the values include JSON escape characters. To fix this problem, perform one of the following actions:

    • Remove the JSON escape character.

    • Encapsulate the string in quotes.

    • Regenerate the key and ensure that it does not include a JSON escape character.

    • Specify the key and secret manually.

    Do not remove the forward slash / because it is a valid character.