How do i fix ownerships and permissions of redhat package files using rpm?

  • Man page for rpm.

           rpm --setperms PACKAGE_NAME
                  sets permissions of files in the given package.
           rpm --setugids PACKAGE_NAME
                  sets user/group ownership of files in the given package.

    First run this command, it sets the ownership and groups on files, which can cause the permission to reset and lose set-uid and set-gid permissions.

    $ sudo rpm --setugids hello-world-1-1.x86_64.rpm

    Then run this.

    $ sudo rpm --setugids hello-world-1-1.x86_64.rpm

    Note: It is highly recommended the software related to the package files are not in use when running commands that change ownerships, groups, and permissions. Especially on production environments.

Log in to reply

© Lightnetics 2020