Ok , I will try to clear my goal.
If I append:

Host * controlmaster auto controlpath /tmp/ssh-%r@%h:%p

to ssh_config file,
Then I can: ssh host@ip:port to my server multiple times , and from the server side, I will only see only one active connection (the first one).
I would like to achieve samething using OpenSSH perl module.
What I can see is that openssh module creates random sockets , so it will never reuse an existing one (please add your opinion here)
like:

[root@smokeping probes]# ls -altr /tmp/.libnet-openssh-perl/ total 8 drwxrwxrwt. 12 root root 4096 Oct 1 10:02 .. srw-------. 1 root root 0 Oct 1 10:02 77920c754112ab47c6163bcfc58 +bed18 srw-------. 1 root root 0 Oct 1 10:02 0c600465ef924c5229c418a8871 +b9d36 srw-------. 1 root root 0 Oct 1 10:02 e675b23529a57eb7b59e85a7237 +7df74 srw-------. 1 root root 0 Oct 1 10:02 e4690abec752975a4476dd63232 +19814 srw-------. 1 root root 0 Oct 1 10:02 d3e28b44e996a2c3858850156cc +3b238 srw-------. 1 root root 0 Oct 1 10:02 24c7eb01f6b8e230db4e7ad7464 +6cc54 srw-------. 1 root root 0 Oct 1 10:02 8146e02629748a287f979c16827 +6b114 srw-------. 1 root root 0 Oct 1 10:02 6a7ebf7458398a282a947479de0 +14edc srw-------. 1 root root 0 Oct 1 10:02 6c1ebc546764c1bfbd755d1820d +bf5a5 srw-------. 1 root root 0 Oct 1 10:02 67d4449c8336035d4bc66fccf47 +ceddf srw-------. 1 root root 0 Oct 1 10:02 af933a70fa19f2e0631dd381587 +d9797 srw-------. 1 root root 0 Oct 1 10:02 09653a62f88e4954a6ba2c85a74 +37400 srw-------. 1 root root 0 Oct 1 10:02 b8b2ecc3c59c9bd14a147b0f4e4 +ebb01 srw-------. 1 root root 0 Oct 1 10:02 c9eb9ff5c25c1ea8bf8ae6fa0a9 +e6550 srw-------. 1 root root 0 Oct 1 10:02 966185842d9ab1ff5ce17afd3c9 +51893 srw-------. 1 root root 0 Oct 1 10:02 cf32ef2944cab6c8aeb5055b1a6 +72ee3 srw-------. 1 root root 0 Oct 1 10:02 a6c87213c639efca7be3d902b97 +f14ca srw-------. 1 root root 0 Oct 1 10:02 7c903101f2588c0d59ba1951806 +ab423 srw-------. 1 root root 0 Oct 1 10:02 0d8fe313c0fe25601df92bd10f5 +5f48a srw-------. 1 root root 0 Oct 1 10:02 5073e76ae24b05de392b4b12577 +7138e srw-------. 1 root root 0 Oct 1 10:02 a3c0acb9d2765801610a1c80c88 +e8086

So ... I dont know whow to tweak it to work as I want.
Should I force openssh module to create allways same socket and then add the propper rule to ssh_config system file ?
or both , perl module and ssh system client does nothing to do between them ?
Ok , hope to be more clear about my task.
Thanks.


In reply to Re^2: Net::OpenSSH mater mode is not working by leostereo
in thread Net::OpenSSH mater mode is not working by leostereo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.