Forbidden create new connection when reach the maxsessions of sshd using net: OpenSSH | disable net: opens

Source: Internet
Author: User

After asking for help at the perlmonks forum, the author of the Net: OpenSSH module replied.

Http://www.perlmonks.org /? Node_id = 923770

----------------------------------------------------------------------

It seems that once the maxsessions limit is reached, the SSH client tries to establish a new connection.

As a workaround, the following hack seems to work, just making the command fail:

My $ SSH = net: OpenSSH-> New ($ host );
Push @ {$ ssh-> {_ ssh_opts}, '-oconnectionattempts = 0 ';
...
[Download]

AfterCaptureMethod call, in case of too reset session,$ Ssh-> ErrorWill beOssh_slave_pai_failedAnd$? = 255.

I will add some option to the constructor to allow for setting slave SSH arguments without fiddling with the object interiors.

Anyway, instead of Forking and unlimited number of processes, you cocould also use parallel: forkmanager or proc: queue to get it under control.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.