Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

i have some web servers around and to manage the cluster i sometimes use script which opens automatically the connections and syncs files to them using python scripts, I've encountered a weird problem and i don't really know how to fix it..

to reproduce test case you should have a remote destination which doesn't do the connection immediately (not in LAN & nor in localhost ) and the connection should run without asking for password ( using key files)

i have 16 PCs running Fedora, servers have Cent OS 5 , s120 & s121 -- are 2 severs i own with IP addresses assigned in /etc/hosts to s121 & s120

this is a sample command which opens 9 connections to s120 + 9 connection to s121 in the same shell at the same time.. AND IT WORKS!

gnome-terminal --tab -e "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh root@s120;\"" --tab
-  e "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh
root@s120;\"" --tab -e "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh root@s120;\"" -- tab 
-e "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh
root@s121;\"" --tab -e "bash -c \"ssh root@s121;\"" --tab -e "bash -c \"ssh root@s121;\"" --tab 
-e "bash -c \"ssh root@s121;\"" --tab -e "bash -c \"ssh root@s121;\"" --tab -e "bash -c \"ssh
 root@s121;\"" --tab -e "bash -c \"ssh root@s121;\"" --tab -e "bash -c \"ssh root@s121;\"" --tab 
-e "bash -c \"ssh root@s121;\""

this command TRIES to open 15 connections on the same shell all 15 TO-> s120

gnome-terminal --tab -e "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh root@s120;\"" --tab
-e "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh 
root@s120;\"" --tab -e "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh root@s120;\""       
--tab - e   "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh root@s120;\""  --tab -e "bash 
- c \"ssh
 root@s120;\""  --tab -e "bash -c \"ssh root@s120;\""  --tab -e "bash -c \"ssh root@s120;\""  
--tab -e "bash -c \"ssh root@s120;\""  --tab -e "bash -c \"ssh root@s120;\""  --tab -e "bash -c 
\"ssh root@s120;\""

and it will attempt to open 15 connections which almost immediately 5 tabs close themselves and only 10 connections stay open. this problem also happen in terminal_xfce (which i prefer because I've found gnome-terminal a bit less stable)

seems that more than 10 concurrent opening connections are not allowed,

it seems that not more than 10 concurrent connections at the start are allowed but if i open 10 tabs, and wait for the connections to get started, then i can open another terminal with 10 tabs to same server.

(i want also to say that this test results are the same with IP TABLES firewalls disabled on both client and servers )

i have also to say that this issue is annoying especially on lsyncd and rsync executions while synchronizing multiple destinations on file system into the same server leads to unexpected results because connections are terminated by the OS , the terminal test-case is just the simpler to reproduce even if less problematic to handle.

share|improve this question

2 Answers 2

Look for MaxStartups in /etc/ssh/sshd_config.

  • It limits the unauthorized concurrent logins to sshd.

  • The default is 10.

share|improve this answer

If all your connections are going to be using scripted commands... why use the gnome-terminal tabs? You're using lots of resources which you really don't need, and which may be contributing to the limiting factors you're experiencing.

You should be able to get almost (for your purposes) unlimited number of connections if you'll let the system handle the connections instead of forcing gnome-terminal to step in.

for a in $( seq 1 50 ); do
  ssh root@s120 my_cool_script &
  ssh root@s121 my_cool_script &

This should create 100 connections (50 to s120, 50 to s121) within seconds, all running '*my_cool_script*'. As long as whatever you're doing is scripted, it'll proceed nicely.

The 'wait' command causes the script there to wait for all the backgrounded jobs to complete before it continues. You may not need/want that.

(plus it's a WHOLE lot less typing...)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.