Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: Correct way to use Net:SSH2 module

by runrig (Abbot)
on Mar 18, 2013 at 22:32 UTC ( #1024171=note: print w/replies, xml ) Need Help??

in reply to Correct way to use Net:SSH2 module

When I had that issue, I wrote an wrapper for executing commands that always followed the command with echo'ing "COMMAND_IS_DONE" or somesuch. Then keep reading until you see your marker.

Update: "echo"?? It's often a shell builtin. My condolences. But I think you could satisfactorily uniquify a "COMMAND_IS_DONE" string by adding a pid or other random digits/characters...

Replies are listed 'Best First'.
Re^2: Correct way to use Net:SSH2 module
by MikeKulls2 (Novice) on Mar 18, 2013 at 23:26 UTC
    That is what we are doing but it is something I want to eliminate as it has the obvious fault if the command returns COMMAND_IS_DONE for any reason. We are also connecting to a lot of routers that have their own command set which doesn't include echo.
Re^2: Correct way to use Net:SSH2 module
by MikeKulls2 (Novice) on Mar 19, 2013 at 01:04 UTC
    You need to remember that connecting to a shell is only one option with SSH and we might not even be connecting to linux/unix. We are dealing with big network boxes that implement their own environment that is not shell and absolutely zero shell commands works (even if these boxes do have shell it is likely a massive deal getting access to it). Sometimes the boxes talk XML. Other times we avoid shell and communicate directly with our own perl script on the remote server. This works really well because we can give a remote dept access to talk to our script only and we can really control what they can do then. It beats giving them shell access and hoping that we locked everything down correctly. Come to think of it I pretty much never connect to a shell, certainly I would exhaust every other option first. Using shell is generally going to result in code that breaks with different OSes. With regards the uniqueness I think you are correct, it would be possible to get something unique. However, again it is something I would use as a last resort as it is still a hole in the software that could possibly be a security risk.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1024171]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2018-05-25 23:41 GMT
Find Nodes?
    Voting Booth?