Solved

Allow only one SSH connection

Posted on 2001-07-24
7
374 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
what is the size of a TCP segment 10 88
Help instaling linux on vmware 36 85
dns master and slave in linux 2 69
Computers missing from Windows Explorer Networks 10 100
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

776 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