Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Allow only one SSH connection

Posted on 2001-07-24
7
Medium Priority
?
411 Views
Last Modified: 2010-05-18
Is it possible to set up the SSH daemon so that only one incoming connection is allowed at a time, and that all other connection attempts are denied?
0
Comment
Question by:interiot
6 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6313751
see  MaxStartups  in sshd.conf
0
 
LVL 3

Author Comment

by:interiot
ID: 6313822
I want only one authenticated connection at a time.  It looks like MaxStartups controls the number of unauthenticated connections.

0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 200 total points
ID: 6313924
oops, didn't see the "unauthenticated".

Seems that sshd (even openssh) does not support it.
You may try following (just an idea, not tested):

start sshd using tcpd as wrapper with inetd
but instead of starting sshd directly by tcpd, use a script, like

     (/usr/sbin/sshd <your options> && rm /etc/nologin) &
     sleep 1   # just to make shure that the connection is established
     echo "ssh login currently not permitted">/etc/nologin
     exit 0
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 16

Assisted Solution

by:The--Captain
The--Captain earned 200 total points
ID: 6324864
Easy - just run it with the -i flag (spawned from inetd/xinetd/etc), and then just use xinetd to limit the amount of connections to 1.

Alternatively (not recommended), you could use the -d argument.

-Jon
0
 

Expert Comment

by:CleanupPing
ID: 9078732
interiot:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 7

Expert Comment

by:troopern
ID: 9978311
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Split between ahoffmann & The--Captain.
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

troopern
EE Cleanup Volunteer

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question