ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexGeneral IBM MQ SupportSSH issues with amqsput

Post new topicReply to topic
SSH issues with amqsput View previous topic :: View next topic
Author Message
jk67564
PostPosted: Tue May 21, 2019 12:22 pm Post subject: SSH issues with amqsput Reply with quote

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:

Code:
ssh user@host


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

Code:
ssh user@host


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
View user's profile Send private message
fjb_saper
PostPosted: Wed May 22, 2019 6:20 am Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20130
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
View user's profile Send private message Send e-mail
PeterPotkay
PostPosted: Wed May 22, 2019 11:15 am Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7578

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
View user's profile Send private message
fjb_saper
PostPosted: Thu May 23, 2019 5:23 am Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20130
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
View user's profile Send private message Send e-mail
gbaddeley
PostPosted: Sun May 26, 2019 3:48 pm Post subject: Re: SSH issues with amqsput Reply with quote

Jedi

Joined: 25 Mar 2003
Posts: 2037
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
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexGeneral IBM MQ SupportSSH issues with amqsput
Jump to:



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.