Creating a read-only database user account for IBM DB2

book

Article ID: 179867

calendar_today

Updated On:

Products

Security Information Manager

Issue/Introduction

 

Resolution

Creating a read-only database user account for IBM DB2

Collectors that use a database sensor require that you create a read-only database user account so that the collector can query for events.

See Installing collectors that use a database sensor.

To create a read-only database user account for IBM DB2

  1. Log in as root to the computer with IDM DB installed.

  2. To create a local user, at a command prompt, type the following command:

    adduser user_name -g users -s /sbin/nologin

  3. To set the password for the user db2test, type the following command:

    passwd user_name

  4. To access the database command prompt, type the following command:

    db2

  5. To connect to a DB2 alias, at the db2 command prompt, type the following command:

    connect to db2_alias

    For example, you can type the following command:

    connect to SSIM

  6. To grant connect privileges to the user user_name, type the following command:

    GRANT CONNECT ON DATABASE TO USER user_name

  7. To grant access to specific tables to the user db2test, type the following commands:

    GRANT SELECT ON database_name.table_name TO USER user_name