Confined sysadm or staff users cannot administer PostgreSQL database

Solution Verified - Updated -

Issue

  • On systems having the users confined (e.g. mapped to staff_u or sysadm_u), power users (e.g. users in wheel group) cannot execute sudo su - postgres to administer the PostgreSQL database

    $ id -Z
    staff_u:staff_r:staff_t:s0-s0:c0.c1023
    
    $ sudo su - postgres
    [...]
    su: warning: cannot change directory to /var/lib/pgsql: Permission denied
    

Environment

  • Red Hat Enterprise Linux 7 (RHEL7) and later
    • confined users
    • postgreSQL

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content