ibm-messaging / mq-container

Container images for IBM® MQ
Apache License 2.0
255 stars 189 forks source link

can't add a new user and who is the current user #468

Closed adensuen000 closed 3 years ago

adensuen000 commented 3 years ago

when I write dockerfile as follows and excute docker build, it was thow an error: useradd: Permission denied

FROM ibmcom/mq RUN useradd alice -G mqm && \ echo alice:passw0rd | chpasswd

and i would like to know ,who is the current user in the container, i can see the UID is 1001,but i have no idea who is it.

thanks

arthurbarr commented 3 years ago

Since MQ 9.1.5, we've made changes to allow running MQ under more strict security settings. These changes included the removal of the mqm UID and GID. Also, MQ is no longer authorized to check the passwords of Linux users, so you can no longer use the above technique to add users.

The recommendation for production use, is LDAP or mutual TLS. For the MQ Advanced for Developers image only, there is an unsupported MQ auth service which takes users from an htpasswd file. This isn't tested for general use, but you could perhaps update the code to use additional users that way if that's what you need.

arthurbarr commented 3 years ago

Closing this because adding OS users to the image does not work when using the MQ unzippable installer, which this sample uses.