Finding the list of Hue superusers

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

Using the Hue shell and Python code to find Hue superusers

  1. Connecting to Hue 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 Hue superusers

  1. Connect to Hue 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;
    Sample output:
    ----------------------+
    
    username	is_superuser
    ----------------------+
    
    admin	1
    ----------------------+
    1 row in set (0.00 sec)