Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Allow only one SSH connection

Posted on 2001-07-24
7
Medium Priority
?
406 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 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

715 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