DB2 on Linux can read a pam configuration. You can verify by running
db2set DB2AUTH
, it should return
OSAUTHDB
.
You will need to create a
/etc/pam.d/db2
file with the following contents:
auth include system-auth
account include system-auth
password include system-auth
session include system-auth
This will tell DB2 to use the REHL pam.d system-auth configuration.
Now just create a user in db2 matching username that can log into the server. Then you can log into db2 using that user's credentials.
You will need to create a user in the dockerfile/swarm yaml. Or create a shell script that creates the user and copy into /var/custom/. This will run the script automatically.
------------------------------
Kevin Chan
------------------------------
Original Message:
Sent: Tue September 10, 2019 02:57 AM
From: Sven Richter
Subject: docker image with extra user
Hi,
So when I start up the official docker image a db2inst1 user is created automatically and also a database if I want to, which is all great.
But I do need an additional user that has access to the created database. If I read that correctly DB2 uses host users for user management, so do I have to create a host user in the docker host manually and then assign database privileges to that user?
Or is there a better way to do that?
Thanks,
Sven
------------------------------
Sven Richter
------------------------------
#Db2