-
Notifications
You must be signed in to change notification settings - Fork 665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Execute ssh command inside a "for of" #1361
Comments
Be aware that almost all SSH servers have limits on the number of concurrent "channels" you can have open per connection. Channels include things like |
I need to access the equipment and disconnect users, how can I solve this? |
Perhaps only perform one |
If I repeat the command manually, for example 3 times, it does not show the error. but inside the "for" it may be 1 time that it presents the error. I wanted to solve the "for" problem so that I could later solve the ssh limit. |
mscdex ***@***.***> writes:
I would also add that in addition to limits on the number of concurrent
connections, many systems also have a form of rate limiting in the
connection process i.e. key exchange and cipher negotiation - the stuff
done prior to the final 'real' connection. For example, from memory,
openssh allows up to 10 'connection attempts' at once before it starts a
form of rate limiting where it will reject a percentage of connection
attempts up until a maximum of 20 at which time it will stop accepting
connections until the number drops back down.
Note that this is different from concurrent connections. This is about
clients attempting to establish a connection. The point to note is that
the backoff algorithm is initially random wrt deciding which connections
to reject/drop. This can make debugging challenging as behaviour is
different each run. Also, because this is a DDoS mitigation strategy,
the response from the remote server can vary from informative to
attempts simply being dropped with no indication why.
Key point to note is you need to be very careful when making 10+
connections within a very short period with most ssh servers.
|
I'm thinking about dividing it into blocks of 5 and configuring the Cisco router parameters to work like this. However, my main problem is that when adding the connection command ".on("ready", () => {" inside the first "for" and the execution command "conn.exec" inside the second "for" already displays the error. I believe it is not an error with the limitations of ssh, so I need help at the moment. command structure:
|
@rfsilvagyn Without seeing the new code that you're attempting to use, it's difficult to make a suggestion. If you want to keep your |
I have an array where I have "hosts/nas" as main and "logins" as secondary, what I'm trying to do is go through the array connect to "host/nas" go through the "logins" array and for each "login" execute the command, but I have the error:
Node.js v20.11.0
My function code:
The text was updated successfully, but these errors were encountered: