MQ

MQ

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Use the -f and -u options simultaneously with runmqsc

    Posted Fri December 23, 2022 05:38 PM
    Hello,
    To use runmqsc in client mode to a Queue Manager with security enabled, the command looks like
    runmqsc -c -u USER QM
    with the password given at the prompt.

    If now I want to use an MQSC file, the syntax is :
    runmqsc -c -u USER -f file.mqsc QM
    But in this case, the prompt does not allow me to enter a password, the only solution is to provide the password in the first line of the MQSC file.

    Leaving a password in a configuration file does not suit me. Is there another solution for example by combining "-f" for the MQSC file and "<" for the password?

    Thanks and Merry Christmas!

    ------------------------------
    Luc-Michel Demey
    DEMEY CONSULTING
    lmd@demey-consulting.fr
    #IBMChampion
    ------------------------------


  • 2.  RE: Use the -f and -u options simultaneously with runmqsc

    Posted Fri December 23, 2022 09:44 PM

    How about making use of the mqccred security exit to supply the user id and password since you are using a client connection (-c)?

    Cheers,
    Morag



    ------------------------------
    Morag Hughson
    MQ Technical Education Specialist
    MQGem Software Limited
    Website: https://www.mqgem.com
    ------------------------------



  • 3.  RE: Use the -f and -u options simultaneously with runmqsc

    Posted Sat December 24, 2022 08:20 AM
    I always use regular redirection instead of the -f option. At its simplest, you can then do
    (echo $password; cat commands.mqsc) | runmqsc -u userid

    with the way you get/set the password being up to you. It has the benefit of being ephemeral - not showing up on any command line or the environment or in the MQSC file itself.



    ------------------------------
    Mark Taylor
    Winchester
    ------------------------------



  • 4.  RE: Use the -f and -u options simultaneously with runmqsc

    Posted Tue January 03, 2023 09:23 AM
    Hello,

    Best wishes to all for this new year!

    Thanks to Morag and Mark for their suggestions, both interesting and effective.
    In the end I preferred mqccred, because :
    • I had used this option very little, and I wanted to study it more closely
    • The .ini file allows to store user and password, which simplifies the operations for deployments
    The password is encrypted in the file, and seems complicated to retrieve.
    I don't know how robust this encryption is, but it's better than leaving it in the clear in the MQSC file as the KC propose (and in any case, the password travels in clear over the channel, so TLS is highly recommended).

    Now I can comfortably deploy my MQonCloud configurations from my Windows workstation!

    ------------------------------
    Luc-Michel Demey
    DEMEY CONSULTING
    lmd@demey-consulting.fr
    #IBMChampion
    ------------------------------