- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ssh query. command line parameters.
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2003 02:19 PM
09-11-2003 02:19 PM
Public keys have been exchanged.
I try this command line
ssh -tv hostname command parameter1 parameter2
ssh -tv hostname "command parameter1 parameter2"
Same results with out the -tv
The result is: paramete1 and parameter2 are not passed along with the command.
The command is executed on the target system without parameters. Echo statements in the target script show $1 and $2 have no value.
I kind of need those parameters to pass through.
Suggestions on how I should change my syntax that work are an easy rabbit.
I now I can pass the parameters in a file and modify the target script to read that file and work, but I'm trying to learn something here.
regards,
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2003 03:03 PM
09-11-2003 03:03 PM
Re: ssh query. command line parameters.
You must be using perl. Try escape $.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2003 03:24 PM
09-11-2003 03:24 PM
Re: ssh query. command line parameters.
It works exactly for me on 11.11 systems.I wrote a small script that prints $1-$4.
ssh -tv remote_host /tmp/junk.sh 1 2 3 4
--trimmed--
debug1: Sending command: /tmp/jun.sh 1 2 3 4^M
debug1: channel request 0: exec^M
debug1: fd 4 setting TCP_NODELAY^M
debug1: channel 0: open confirm rwindow 0 rmax 32768^M
1^M
2^M
3^M
4^M
debug1: channel 0: rcvd eof^M
debug1: channel 0: output open -> drain^M
debug1: channel 0: obuf empty^M
--trimmed--
Write your script junk.sh exactly like I did and try again. I don't know if it is the problem with your ssh itself.
cat /tmp/junk.sh
echo $1
echo $2
echo $3
echo $4
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2003 03:47 PM
09-11-2003 03:47 PM
Re: ssh query. command line parameters.
Not using perl.
I suppose leading me the right way is worth a rabbit too.
I'm going to re-run in the morning and post up the debug information. I'll also read it a bit more carefully.
I will run a quickie test on my educational D320 and see what happens.
Thanks.
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2003 04:23 PM
09-11-2003 04:23 PM
Re: ssh query. command line parameters.
It worked just fine.
Wondering if the target script is using korn shell if it makes a difference.
I can't attach a log, because I can't capture a log.
I'm so obsessive, its amazing.
A simple test with junk.sh works, so it probably something about the target script thats broke.
I think this situation requires more analysis.
*** scratching my head and thinking.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2003 08:29 PM
09-11-2003 08:29 PM
SolutionRealistically Steven, my friend, you should consider putting that devotion more towards those little ones & not us.
Believe me, we'll survive w/o your insight from time to time.
Cheers,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2003 09:02 PM
09-11-2003 09:02 PM
Re: ssh query. command line parameters.
I actually was playing tunes with the kiddies at the 'puter while I was figuring this out.
Obviously the script is broke.
If someone can tell me how to collect that ssh data without cutting and pasting, that would be useful.
I told a manager I could fix this on Friday. I think I'm screwed.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2003 04:36 PM
09-12-2003 04:36 PM
Re: ssh query. command line parameters.
I first made sure, ssh works without interaction. Then I ran
ssh -tv remote_host /tmp/junk.sh 1 2 3 4 > /tmp/junkssh.out 2>&1
Then I vi'ed /tmp/junkssh.out and pasted only the lines required here.
-Sri
PS: No points please.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2003 02:36 PM
09-14-2003 02:36 PM
Re: ssh query. command line parameters.
I tried it out from a Windows ssh client on that same box and a Linux box running essentially the same release.
Worked great.
The actual production script with the problem executes like this.
ssh -tv hostnname scriptname parm1 parm2
Yet parm1 and parm2 do not show up in write statements at the top of the target script on the target host.
As I said, I think the script is broke. Perhaps the parameters are being nailed by some script stupidness on the server trying to execute the ssh.
I created the thread, because I honestly thought the command line parameters were not being passed. Thats why I handed out a bunny to Jeff when he suggested the junk script.
I thing the script running the ssh isn't loading the variables right and I can't post it because it tells a wee bit too much about our internal server structure(we are due to our work the target of frequent threats, though no successful hacks).
So, its really in debug mode.
Shridar, I always hand out a point or two, even when Harry posts in a joke. Will you stop working on the problem if I give you points? That would be a shame.
I'll ponder the question for a while.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2003 09:56 PM
09-14-2003 09:56 PM
Re: ssh query. command line parameters.
Unless you post your target script here, we are in a dead-lock situation as we already proved that it was not ssh that's causing the issue. I already posted my response of verifying it by running the junk.sh script. That's why I insisted on not giving the points to the next post. I am a believer of points system and I limit that to only for quickly identifying the solution that fixed the member's problem. Rest is upto the member.
-Sri
PS: No points again. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2003 07:23 AM
09-15-2003 07:23 AM
Re: ssh query. command line parameters.
Shridar is right, though I would not use the term deadlock. Its not ssh, or its configuration thats broken, its the script.
Consider this request on hold. If I can't fix the script, I'll get permission from the powers that be and post it.
ON HOLD......
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2003 09:16 AM
09-19-2003 09:16 AM
Re: ssh query. command line parameters.
Thanks to all for their input.
Here was the problem:
The ssh from host1 to host2 did not have the proper user environment when it got to host2.
A modification of the script on host2 to load the user environment wiped out the $1 and $2 variables. This was probably the shift command. It wasn't worth modifying the profile load, 120 users need it anyway.
So here was the fix.
p1=$1
p2=$2
# load the user profile
# modify the rest of the script to use p1 and p2 instead of $1 and $2
This brings to light good scripting practices which are to get data out of $1 and $2 at the top of a shell script.
Food for thought.
I may still be giving lousy point free itrc answers today, but at least my #2 number one priority is in the can, fixed.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com