IBM MQ 8.0, How to specify a username and password for amqsget as command line parameters

I get an error when upgrading to IBM MQ 8.0 from 7.5 reasons -

MQ 8.0 introduces a new feature that requires MQ administrators to use remote access to provide a user ID and password. If the user ID and password are not specified or the password is incorrect

Error: 2035 Code: 2 The queue manager is configured to require a user ID and password, but none of them has been sent.

The problem is described better in this link . There are three scenarios that are talked about. My solution will fall into scenario A) MQ Samples: provide the user and password for the MQ client application

I am trying to read from MQ using a program. Is there a way to pass the username and password as part of the command line options, and not enter it when prompted. Since this exe is called by my program.

$ amqsputc qName qMgr 
+5
source share
4 answers

To accomplish this, IBM provides a client-side security exit called mqccred . Full documentation is provided here, but in general it requires the following:

  • Specify the output in the CCDT file.
  • Configure the output by putting the ID and password in the ini file
  • Run the runmqccred command against the ini file to trick passwords.
  • Make sure the ini file is set so that reading in world and group mode is disabled.

Please note that Java / JMS programs can be easily changed, and the output is mainly for programs that use their own C API or that are compiled on top of this.

+4
source

If your client cannot (yet) specify a username / password, you can disable the username / password requirement in the MQ 8.0 queue manager:

  • Launch MQ Explorer

  • Go to Queue Managers → <your_queue_manager> → Authentication Information

  • Click " Show system objects " in the upper right corner

MQ Explorer / Authentication Information / Show System Objects

  1. SYSTEM.DEFAULT.AUTHINFO.IDPWOSUser ID + PasswordCheck Client Connections → Select More

MQ SYSTEM.DEFAULT.AUTHINFO.IDPWOS / User ID + Password / Check client connections / Optional

  1. Right click on your queue manager and rarr; SecurityUpdate authorization service ...

Right-click Queue Manager, Security, Refresh Authorization Service

+2
source

Have you tried to provide a password using heredoc, for example?

 amqsputc qName qMgr <<< "passwd" 

Send string to stdin

0
source

MQ Samples have been updated to indicate a user ID, and, if asked, will prompt for a password: MQ Bitesize Blogging

Some use the new optional command line parameter [-u User], others check for the presence of the MQSAMP_USER_ID environment variable.

0
source

Source: https://habr.com/ru/post/1243914/


All Articles