Solved

Allow only one SSH connection

Posted on 2001-07-24
7
384 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
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 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

Industry Leaders: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Layer 7 Transparent cookie checker 22 68
Convert Routes to Linux (CENTOS 7.0) 3 113
Linux : how to point the OS to use the new DNS server 11 109
running production stuff on centos 4 134
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

756 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