Author |
Message
|
jk67564 |
Posted: Tue May 21, 2019 12:22 pm Post subject: SSH issues with amqsput |
|
|
Newbie
Joined: 21 May 2019 Posts: 1
|
Hi,
I have a box from which I am accessing my other MQ hosts via SSH. The MQ hosts are on Windows with Cygwin for SSH connection.
I have a need to run amqsput across SSH, so what I usually do is:
and type in the password.
From there amqsput works fine.
For ease of use, I decided to set up an identity file for the box I SSH from using ssh-keygen. I then copied this onto my target hosts:
Code: |
ssh-copy-id user@host |
So now I can connect
with no need for a password. But now when I try to run amqsput I see the following:
Code: |
$ amqsput QUEUE QMGR
Sample AMQSPUT0 start
MQCONNX ended with reason code 2059
|
Any ideas on why this might be happening? |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed May 22, 2019 6:20 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
why would you expecting anything different.
You are not specific enough from which server you issue the command.
You are not specific enough about the antivirus and containment policy for programs of your destination box...
So if you run amqsputc from host 1 to host 2 and I hope you set at least some way to get to host 2 (like MQSERVER variable)...
Or if you run amqsput on host2... and guess what the antivirus containment software might block your in memory connection....
That's all assuming you are running against the primary installation.
If you need to switch installations you need to create the bash version of the setmqenv command...
And don't forget to source it. Only then can you connect.
Here is how this will work:
Connect to your host using bash.
From your bash command prompt run cmd to enter a windows command prompt. Then run the setmqenv command to set all your environment variables. You should now be able to successfully run the amqsput command from the windows command prompt. When done run the exit command to return to the bash shell.
The reason why this is happening is that the mq variables aren't properly defined in your cygwin (bash) shell. So in order to make this work you either branch out to a windows (cmd) shell or you write your own setmqenv.sh (or copy it from a linux install).
Wouldn't it be so much easier to run mstsc against the box instead of ssh???
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
PeterPotkay |
Posted: Wed May 22, 2019 11:15 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
If they are ssh'ed successfully to host x, and host x has the queue manager, the behavior of amqsput shouldn't change on host x because they authenticated differently on their way into host x.
Why would using SSH keys versus ID/Password change how amqsput works? _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu May 23, 2019 5:23 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
PeterPotkay wrote: |
If they are ssh'ed successfully to host x, and host x has the queue manager, the behavior of amqsput shouldn't change on host x because they authenticated differently on their way into host x.
Why would using SSH keys versus ID/Password change how amqsput works? |
Because they're not logging in with a windows prompt but a cygwin (bash) prompt and shell. This means that if the environment is not right you cannot run setmqenv.cmd (setting the environment works differently in bash).
Ergo once logged in create the windows environment running the "cmd" command and then setmqenv. From there on you should have no problems running mq commands in your windows shell.
Problem might arise if you need to run the shell in elevated privilege mode.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
gbaddeley |
Posted: Sun May 26, 2019 3:48 pm Post subject: Re: SSH issues with amqsput |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
jk67564 wrote: |
Hi,
... But now when I try to run amqsput I see the following:
Code: |
$ amqsput QUEUE QMGR
Sample AMQSPUT0 start
MQCONNX ended with reason code 2059
|
Any ideas on why this might be happening? |
Did you look in the AMQERR01.LOG file for diagnostics? Please post the full entry and your analysis. _________________ Glenn |
|
Back to top |
|
 |
|