Pages

Fixing RPM Database Error and Configuring Passwordless Sudo on AIX

Part 1: Fixing RPM Database Error While Installing Sudo
The Problem
While installing sudo 1.9.17-3:
# rpm -Uvh sudo-1.9.17-3.aix71.rpm
The following error appeared:
error: db4 error(22) from dbenv->open: A system call received a parameter that is not valid.
error: cannot open Packages index using db4 - A system call received a parameter that is not valid. (22)
error: cannot open Packages database in /opt/freeware/packages
warning: sudo-1.9.17-3.aix71.rpm: Header V4 DSA/SHA1 Signature, key ID 7ee470c4: NOKEY
Root Cause:
The RPM database in /opt/freeware/packages was corrupted or locked.

Resolution Steps
Step 1: Remove Database Lock Files
# rm -f /opt/freeware/packages/__db*
Step 2: Rebuild the RPM Database
# rpm --rebuilddb
Step 3: Reinstall Sudo
# rpm -Uvh sudo-1.9.17-3.aix71.rpm
Successful output:
Preparing... ################################# [100%]
Updating / installing...
1:sudo-1.9.17-3 ################################# [100%]
Verify Installation
# rpm -qa | grep sudo
Output:
sudo-1.9.17-3.ppc
Part 2: Creating a New Admin User on AIX
After successfully installing sudo, the next step is to create a non-root administrative user.
Step 1: Create the User
# mkuser sysadm
Step 2: Set User Password
# passwd sysadm
You will be prompted:
Changing password for "sysadm"
sysadm's New password:
Enter the new password again:

Part 3: Configure Passwordless Sudo Access
Edit the sudoers file safely using:
# visudo
Add the following line:
sysadm ALL=(ALL:ALL) NOPASSWD: ALL
This grants:
Full sudo privileges
No password required for sudo commands
Always use visudo to prevent syntax errors.

Part 4: SSH Login and Password Expiry Handling
First SSH Login
# ssh sysadm@192.168.122.13
On first login, AIX forces password change:
: 3004-610 You are required to change your password.
WARNING: Your password has expired.
You must change your password now and login again!
You must:
Enter old password
Set a new password
Reconnect
Connection will close automatically after password update.
Second SSH Login (Successful)
# ssh sysadm@192.168.122.13
Successful login message:
Last login: Fri Feb 20 08:51:58 CST 2026
Welcome to AIX Version 7.2!

Part 5: Testing Sudo Access
Once logged in as sysadm, test sudo:
$ sudo su -
If configured correctly:
[indaix13] / #
You now have root shell access via sudo.

No comments:

Post a Comment