All Products
Search
Document Center

Object Storage Service:UserGroupsMapping

Last Updated:Sep 17, 2025

The UserGroupsMapping command is used to manage and query the mappings between users and user groups.

Prerequisites

Step 1: Configure environment variables

  1. You can connect to an ECS instance. For more information, see Connect to an ECS instance.

  2. You can go to the bin directory of the JindoSDK installation.

    The following example uses jindosdk-x.x.x-linux. If you use a different version of JindoSDK, replace the package name with the actual name.

    cd jindosdk-x.x.x-linux/bin/
    Note

    x.x.x represents the version number of the JindoSDK package.

  3. You can create a configuration file named jindosdk.cfg and add the following configuration items to the file.

    [common]Keep the following default configurations.
    logger.dir = /tmp/jindo/
    logger.sync = false
    logger.consolelogger = false
    logger.level = 0
    logger.verbose = 0
    logger.cleaner.enable = true
    hadoopConf.enable = false
    
    [jindosdk]Customize the following configuration items.
    <!-- The following example uses the China (Hangzhou) region. Replace the region as needed. -->
    fs.oss.endpoint = cn-hangzhou.oss-dls.aliyuncs.com
    <!-- Configure the AccessKey ID and AccessKey secret to access the OSS-HDFS service. -->
    fs.oss.accessKeyId = yourAccessKeyId    
    fs.oss.accessKeySecret = yourAccessKeySecret
  4. You can set the environment variable.

    export JINDOSDK_CONF_DIR=<JINDOSDK_CONF_DIR>

    Replace <JINDOSDK_CONF_DIR> with the absolute path of the directory where the jindosdk.cfg configuration file is located.

Step 2: Manage the mappings between users and user groups

Map users to user groups

  • Command syntax

    ./jindo admin -addUserGroupsMapping \
                    [-dlsUri <uri>] \
                    [-user <user>] \
                    [-groups <group1,group2...>]
  • Example

    You can run the following command to map user1 to group1 and group2:

    ./jindo admin -addUserGroupsMapping \
                    -dlsUri oss://examplebucket.cn-shanghai.oss-dls.aliyuncs.com \
                    -user user1 \
                    -groups group1,group2

View user and user group information

  • Command syntax

    ./jindo admin -listUserGroupsMappings \
                    [-dlsUri <dlsUri>] \
                    [-maxKeys <maxKeys>] \
                    [-marker <marker>]
  • Example

    This example shows how to view information about 10 users whose names contain the 'test' mark in a specific path.

    ./jindo admin -listUserGroupsMappings \
                    -dlsUri oss://examplebucket.cn-shanghai.oss-dls.aliyuncs.com \
                    -maxKeys 10 \
                    -marker test

    The -maxKeys and-marker options are both optional.

    • The -maxKeys option is used to specify the number of users that you want to query.

    • The -marker option is used to filter users whose names contain a specific string.

Delete the mappings between users and user groups

  • Command syntax

    ./jindo admin -deleteUserGroupsMapping \
                     [-dlsUri <uri>] \
                     [-user <user>]
  • Example

    You can run the following command to delete the mappings between user1 and the user groups to which user1 belongs:

    ./jindo admin -deleteUserGroupsMapping \
                    -dlsUri oss://examplebucket.cn-shanghai.oss-dls.aliyuncs.com \
                    -user user1