Unix/Linux Go Back    

UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

Max numer of connections per sshd

UNIX for Advanced & Expert Users

Thread Tools Search this Thread Display Modes
Old Unix and Linux 12-20-2007
nhatch nhatch is offline
Registered User
Join Date: Aug 2002
Last Activity: 15 March 2011, 2:13 PM EDT
Location: London, England
Posts: 92
Thanks: 1
Thanked 0 Times in 0 Posts
Max numer of connections per sshd

Hi people,

How many ssh or scp connections will an sshd process allow to conenct?

I'm hoping this is an easy question.

Linux x86_64 GNU/Linux

I have a Linux server that has spawned 34 sshd processes, thought this doesn't seem to be enough. The server is used for application monitoring and as a result will have a large number of connections made each minute. We now have got to a point where it will not allow new connections.

You either get the "Welcome" message and no prompt or ssh_exchange_identification: Connection closed by remote host


Sponsored Links
Old Unix and Linux 12-20-2007
sysgate's Unix or Linux Image
sysgate sysgate is offline Forum Advisor  
Unix based
Join Date: Nov 2006
Last Activity: 17 November 2016, 5:32 AM EST
Location: Bulgaria
Posts: 1,420
Thanks: 0
Thanked 6 Times in 6 Posts
There's no such option in sshd_config file. You can write custom wrapper script, who will be checking connections and their number on the SSH port, if reach max number - print some banner (connection refused : max number reached), if not - print some welcome banner.
Sponsored Links
Old Unix and Linux 12-20-2007
craigp84 craigp84 is offline
Registered User
Join Date: May 2007
Last Activity: 1 October 2013, 7:10 PM EDT
Location: Glasgow, Scotland
Posts: 72
Thanks: 1
Thanked 3 Times in 3 Posts
You're possibly making connections at a rate which exceeds the number of new connections allowed at any one time.

SSHd will limit new connections, which have not yet completed authentication, in an attempt to avoid DOSing the whole machine if someone were to create thousands of ssh connections to your host.

So although the number of real connections is effectively unlimited AFAIK, there is a hard limit on the number of connections which are made, but are in the process of authenticating.

See the "MaxStartups" explaination in the sshd_config man page for full details.

Hope this helps,

Old Unix and Linux 12-20-2007
porter porter is offline Forum Advisor  
Registered User
Join Date: Jan 2007
Last Activity: 8 January 2008, 6:50 PM EST
Posts: 2,965
Thanks: 0
Thanked 5 Times in 5 Posts
You may find that pseudo-terminals are the limit.

Try using ssh to allocate sessions without a pseudo-terminal using "-T" in the client.

As each session is accepted and forked it should not be a file descriptor per process limit.
Sponsored Links

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Checking concurrent SSHD connections Prateek007 UNIX for Advanced & Expert Users 4 10-18-2011 12:52 AM
no sshd log hezry79 Solaris 5 04-01-2009 10:04 AM
It helps in the sshd on sshd.log sandba AIX 0 07-28-2006 09:39 PM
sshd restart ashterix AIX 2 11-28-2005 10:50 AM
sshd norsk hedensk UNIX for Dummies Questions & Answers 2 10-10-2002 12:08 PM

All times are GMT -4. The time now is 10:11 AM.