Solved

Allow only one SSH connection

Posted on 2001-07-24
7
363 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
7 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 50 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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 16

Assisted Solution

by:The--Captain
The--Captain earned 50 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

757 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now