Creating a dedicated DB2 user
Create a dedicated IBM® DB2® database user named lcuser with restricted privileges.
About this task
To create a dedicated DB2 database user named lcuser, complete the following steps:
Procedure
Choose your operating system:
- AIX® or Linux™
- Log into the DB2 server as the root user, and then type
the following command to create a new
user:
useradd -g db2iadm1 lcuser echo "lcuser:password" | chpasswdwhere password is new password for the new user. You can specify a home directory other than the default by entering useradd -g db2iadm1 -m -d /db2home/lcuser lcuser.
- Log into the DB2 server as the root user, and then type
the following command to create a new
user:
- Windows 2016
- Click .
- Create the user account:
- Enter lcuser for the name of the new account.
- Enter a password for the account.
- Enter the password again to confirm it.
- Add a hint for the password (required).
- Click OK.
- Set the new account's type as administrator:
- Click the newly created account to select it.
- Click Change the account type.
- Select Administrator.
- Click the Change the account type button.
- Right-click Computer, select Manage in the menu.
- Select , right-click lcuser, and then select Properties.
- In the pop-up window select Member Of tab, click Add and enter DB2USERS in the Enter the object name to select field.
- Click Check Names and then click OK.
- Click OK again to save your changes.Note: If the DB2USERS group is not found, extended security for DB2 on Windows™ might not be enabled. See the DB2 documentation for information about Extended Windows security using DB2ADMNS and DB2USERS groups.
- Windows 2012
- Click and select .
- Enter lcuser for the name of the new account. The account type should be administrator.
- Click the newly created account, click Create a Password to give a password to the new account.
- Right-click Computer, select Manage in the menu.
- Select , right-click lcuser, and then select Properties.
- In the pop-up window select Member Of tab, click Add and enter DB2USERS in the Enter the object name to select field.
- Click Check Names and then click OK.
- Click OK again to save your changes.Note: If the DB2USERS group is not found, extended security for DB2 on Windows might not be enabled. See the DB2 documentation for information about Extended Windows security using DB2ADMNS and DB2USERS groups.
What to do next
For more information about granting privileges to users, go to the DB2 information center.
