0

I wrote the below loop that creates ssh connections to remotehost1

$ cat sshloop.sh
#!/bin/sh
i=0
while [ $i -ne 500 ]
do
                i=$(($i+1))
                echo "SSH COUNT IS: $i"
                       ssh oracle@remotehost1 'uptime'
                done

This scripts runs and makes all 500 ssh connections to remotehost1.

However, when i change the script to make connections to remotehost2 ssh oracle@remotehost2 'uptime' it hangs / stops after 20 connections only.

Where can i check this limit of 20 ssh connections only; and how can i increase it?

remotehost2 is

$ uname -a
SunOS remotehost2 5.11 11.4.34.94.4 sun4v sparc sun4v

The issue seems to be with the nofile value on remotehost2 which is far less than what we have on remotehost1 where it works fine. The issue could be something else as well. I m not sure as of now.

Can you tell me the command to increase the nofile value on solaris?

Kindly suggest.

4
  • 1
    Fwiw, your loop is not running ssh in parallel, but in sequential order. Commented Jul 19, 2021 at 21:58
  • As A.B pointed out, your ssh connections are not in parallel so searching in ssh settings will probably not give you an answer. My guess would be connections are limited with firewall. Here is an example cyberciti.biz/faq/…. Commented Jul 20, 2021 at 5:42
  • As the others have stated, at no point do you have multiple SSH connections/sessions running. Commented Jul 20, 2021 at 7:23
  • @All i agree these are serial connections but where is the limit for only 20 such connections made so i could increase it? Commented Jul 20, 2021 at 10:53

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.