HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
cancel
Showing results for 
Search instead for 
Did you mean: 

Limit SSH connections

 
SOLVED
Go to solution

Limit SSH connections

Hi,

Can anyone tell me how the we can limit the no. of ssh connections to the HP-UX server.

I tried setting MaxStartups value in /etc/ssh/sshd_config file, but it is not working as i expect.

--Mrunal
7 REPLIES
Hakki Aydin Ucar
Honored Contributor

Re: Limit SSH connections

1-) Alternatively, random early drop can be enabled by specifying the three colon separated values ``start:rate:full'' (e.g.,"10:30:60") in this case I guess max. number of you need to limit must be 60.

2-) Did you restart sshd daemon ?
Mounaam
Trusted Contributor

Re: Limit SSH connections

Hi,

I don't think that MaxStartups answers your need.
It applies only for *unauthenticated* connections:
--8<--
MaxStartups
Specifies the maximum number of concurrent unauthenticated con-
nections to the sshd daemon. Additional connections will be
dropped until authentication succeeds or the LoginGraceTime ex-
pires for a connection. The default is 10.

Alternatively, random early drop can be enabled by specifying the
three colon separated values ``start:rate:full'' (e.g.,
"10:30:60" ). sshd will refuse connection attempts with a proba-
bility of ``rate/100'' (30%) if there are currently ``start''
(10) unauthenticated connections. The probability increases lin-
early and all connection attempts are refused if the number of
unauthenticated connections reaches ``full'' (60).
-->8--

Regards,
Mounaam

Re: Limit SSH connections

You are right Mounaam.
That option do not solve my purpose.

So is it that, there is no way to configure ssh connection limit on HP-UX servers?
Innate Ideas
Occasional Visitor

Re: Limit SSH connections

If your version of ssh is 5.1 or newer the Maxsessions 1 option might work for you. It does not limit the total number of connections to the server but it does limit number of connections per client IP address.
Srikanth Kancharla
Occasional Advisor
Solution

Re: Limit SSH connections

Hi There,

You can try some thing like this
/etc/default/security
NUMBER_OF_LOGINS_ALLOWED=XX

Re: Limit SSH connections

Thanks all for you inputs.

NUMBER_OF_LOGINS_ALLOWED works for any non-root user. This has solved my problem.

Thanks again to all of you!

Re: Limit SSH connections

The inputs i have received on this thread has solved my issue.

Therefore closing this thread.