Finding the list of Cloudera Data Explorer (Hue) superusers

You can fetch the list of superusers by using the Data Explorer shell with Python code or by running a SQL query on the auth_user table.

Using the Data Explorer shell and Python code to find Data Explorer superusers

  1. Connecting to Data Explorer shell by running the following command:
    /opt/cloudera/parcels/CDH/lib/hue/build/env/bin/hue shell --cm-managed
  2. Enter the Python code as follows:
    from django.contrib.auth.models import User
    print "%s" % User.objects.filter(is_superuser = True)
    Sample output:
    <QuerySet [<User: admin>]>

Running a SQL query on the auth_user table to find Data Explorer superusers

  1. Connect to Data Explorer database shell by running the following command:
    /opt/cloudera/parcels/CDH/lib/hue/build/env/bin/hue dbshell --cm-managed
  2. Run the following SQL query:
    select username, is_superuser from auth_user where is_superuser=1;

    The superuser status is stored as a boolean value, though its representation varies by database: 1 for true and 0 for false, or t for true and f for false.

    Sample output:
    ----------------------+
    
    username	is_superuser
    ----------------------+
    
    admin	1
    ----------------------+
    1 row in set (0.00 sec)