What is the problem?!
Any errors you're getting..
thekashyap
Practically a Posting Shark
811 posts since Feb 2007
Reputation Points: 254
Solved Threads: 75
Skill Endorsements: 0
Have you setup passwordless ssh between entry-point and target machines?
If not I'm surprised that you got any output as I would expect that when ssh -T myuser@targetpc is executed it hangs instead of giving permission denied. But then the IO redirection with SSH is always shaky/complex to understand.
Perhaps first ssh didn't create any input stream when it executed second ssh, which in turn wanted the password. And thus the second one executed immediately without password and failed. But this is of course guess..
What I would usually do while dealing with remote machines is to
- create a one liner script, which does what I want then
---- The script ensures that it puts all output in some "output file".
- copy this (via rcp/scp) to the remote machine
- execute the script with ssh
- fetch the "output file", parse and find the result.
This is purely for reliability and working around the thousand issues that ssh has with IO redirection.
In your case if you do this it would surely help to point out where the problem is. You'll get better understanding of the flow and which command is doing what. (of course I assume that you'll make your one liner script write enough log messages to output file_:) )
thekashyap
Practically a Posting Shark
811 posts since Feb 2007
Reputation Points: 254
Solved Threads: 75
Skill Endorsements: 0