Reply
New Contributor
Posts: 1
Registered: ‎05-12-2015
Accepted Solution

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

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

Cloudera Employee
Posts: 94
Registered: ‎07-31-2013

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

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()
Announcements