Support Questions

Find answers, ask questions, and share your expertise

Enable superuser in hue with desktop.auth.backend.PamBackend and postgres external DB

avatar
New Contributor

Hi,

We have recently updated cluster to CDH 5.3.3. We have migrated hue database to external Postgres version 9.2. We enabled security with sentry. Also we have changed mode of authentication in hue to desktop.auth.backend.PamBackend. After these, changes, ldap users are able to login and everything works fine. But no more superusers in hue.

Please let me know the steps to re-enable superuser status for admin users and normal users.

Regards,
Jibin

1 ACCEPTED SOLUTION

avatar
Super Collaborator

You can do the following:

 

1.  Spawn the Hue shell:

 

export HUE_CONF_DIR="/var/run/cloudera-scm-agent/process/`ls -alrt /var/run/cloudera-scm-agent/process | grep HUE | tail -1 | awk '{print $9}'`"
cd /opt/cloudera/parcels/CDH/lib/hue (or /usr/lib/hue if using packages)
./build/env/bin/hue shell

 

2.  Paste the following python in the shell replacing <username> with the user you want to become superuser:

 

from django.contrib.auth.models import User
a = User.objects.get(username='<username>')
a.is_staff = True
a.is_superuser = True
a.save()

View solution in original post

1 REPLY 1

avatar
Super Collaborator

You can do the following:

 

1.  Spawn the Hue shell:

 

export HUE_CONF_DIR="/var/run/cloudera-scm-agent/process/`ls -alrt /var/run/cloudera-scm-agent/process | grep HUE | tail -1 | awk '{print $9}'`"
cd /opt/cloudera/parcels/CDH/lib/hue (or /usr/lib/hue if using packages)
./build/env/bin/hue shell

 

2.  Paste the following python in the shell replacing <username> with the user you want to become superuser:

 

from django.contrib.auth.models import User
a = User.objects.get(username='<username>')
a.is_staff = True
a.is_superuser = True
a.save()