AUTHINFO(SYSTEM.DEFAULT.AUTHINFO.IDPWOS) AUTHTYPE(IDPWOS) CHCKCLNT(OPTIONAL)
will require that if a password is sent that it is a valid password.
The AMQ8077
error you are getting is because the user does not have permissions to connect to the queue manager.
You must grant OAM permission to allow clientadmin
to connect
to the queue manager.
By default on Linux you can grant MQ OAM permissions only against a group that a user is a member of, in your case a group that clientadmin
is a member of. In MQ v8.0 and later if the following setting has been added to the qm.ini you can also grant OAM permission against the user itself:
Service:
SecurityPolicy=user
The above setting is not required, it just allows two different ways to grant OAM permissions. This is documented in the IBM MQ v8.0 Knowledge center page "Principals and groups". This page states:
UNIX and Linux systems
ACLs are based on both user IDs and groups and you can use either for authorization.
With Version 8.0, you can use the user-based model for authorization, and this allows you to use both users and groups. However, when you specify a user in the setmqaut command, the new permissions apply to that user alone, and not any groups to which that user belongs.
See Installable services for more information.
When you are using the group-based model for authorization, the primary group to which the user ID belongs is included in the ACL.
The individual user ID is not included and authority is granted to all members of that group. Because of this, be aware that you can inadvertently change the authority of a principal by changing the authority of another principal in the same group.
This is documented in the IBM MQ v8.0 Knowledge center page "Installable services". This page states:
SecurityPolicy=user|group|default
On UNIX and Linux systems the value specifies whether the queue manager uses user-based or group-based authorization. Values are not case sensitive.
If you do not include this attribute, default is used, which uses group-based authorization. Restart the queue manager for changes to become effective.
To grant OAM permission to connect to the queue manager against a group you can do it either with a MQSC command SET AUTHREC
:
SET AUTHREC PROFILE('self') GROUP('groupname') OBJTYPE(QMGR) AUTHADD(CONNECT,DSP,INQ)
The same can be accomplished with a command line tool setmqaut
:
setmqaut -m <queue_manager_name> -t qmgr -g groupname +connect +dsp +inq
To grant OAM permission to connect to the queue manager against the user itself you can do it either with a MQSC command SET AUTHREC
:
SET AUTHREC PROFILE('self') PRINCIPAL('clientadmin') OBJTYPE(QMGR) AUTHADD(CONNECT,DSP,INQ)
The same can be accomplished with a command line tool setmqaut
:
setmqaut -m <queue_manager_name> -t qmgr -p clientadmin +connect +dsp +inq
You would need to also grant PUT or GET access to the queue you want to access. The following example using a MQSC command SET AUTHREC
is using the principal but you can change it to use a group if required:
SET AUTHREC PROFILE('QUEUE.NAME') PRINCIPAL('clientadmin') OBJTYPE(QUEUE) AUTHADD(PUT,GET,BROWSE,DSP,INQ)
The same can be accomplished with a command line tool setmqaut
:
setmqaut -m <queue_manager_name> -t queue -p clientadmin +put +get +browse +dsp +inq
Update 2017/02/21
Setting permission on Linux using -p without having SecurityPolicy=user is not recommended. This is because this action does NOT set the permission against the user specified with -p, it instead sets it against the primary group of that user at the time you run the command.
This can cause various situations, a few examples I can think of are below:
- If you have two users with the same primary group and you provide them different access levels, they both end up with the same level of access that resulted from the last setmqaut command that you ran.
- Even if you provided them both the same level of access to begin with you may want to remove access from one of the two users and issue a similar command with the permission
-remove
specified. The result would not be that you removed the access from one of the two users, but you instead removed it from both users.
- It is not uncommon for the primary group of a unix account to change. If the user is not also a member of that same group as a secondary group after the change they will loose access to MQ.
It is also not recommended to provide a non-administrative user with +all
, if you do this you might as well add the user to the mqm
group and provide them with full MQ administrative authority.
You should instead provide the user with the specific permissions that are required. I provided in my example a limited set of permissions that should work for most applications.