LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-19-2009, 11:32 PM   #1
lasygsd
LQ Newbie
 
Registered: Apr 2009
Posts: 2

Rep: Reputation: 0
SSH concurrent session limit and idle session time out


Hi All,

How do we limit the number of concurrent remote ssh session to 5 and session idle time out is 5 Minute

Thanks in advacne
 
Old 04-20-2009, 12:57 AM   #2
centralb
LQ Newbie
 
Registered: Jan 2007
Distribution: Redhat, Debian, "Custom"
Posts: 27

Rep: Reputation: 15
Assuming you're using OpenSSH, you can limit unauthenticated connections with the MaxStartups directive in sshd_config.

If your situation permits, also use "PermitRootLogin no" and specify the users able to use SSH with "AllowUsers user1 user2 usern..."


For Idle Timeout, use the ClientAliveInterval and ClientAliveCountMax directives.

For more details:

Code:
man sshd_config
Also, it's a good idea to search the forums first before posting questions. A lot of questions have already been asked and answered.
 
Old 04-21-2009, 10:11 PM   #3
lasygsd
LQ Newbie
 
Registered: Apr 2009
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by centralb View Post
Assuming you're using OpenSSH, you can limit unauthenticated connections with the MaxStartups directive in sshd_config.

If your situation permits, also use "PermitRootLogin no" and specify the users able to use SSH with "AllowUsers user1 user2 usern..."


For Idle Timeout, use the ClientAliveInterval and ClientAliveCountMax directives.

For more details:

Code:
man sshd_config
Also, it's a good idea to search the forums first before posting questions. A lot of questions have already been asked and answered.
Hi

Thanks for your replay.I know all this settings but i want to limit the session for authenticated users. That means in my server i want to allow concurrent remote login only from 5 users if 6th user try he should get access denied
 
Old 10-30-2014, 07:56 AM   #4
DontBeWindows
LQ Newbie
 
Registered: Oct 2014
Posts: 3

Rep: Reputation: Disabled
I know it's been a while, but I was looking for the same thing today.

Quote:
Originally Posted by lasygsd View Post
How do we limit the number of concurrent remote ssh session to 5 and session idle time out is 5 Minute
in /etc/sshd_config:
MaxSessions 5

See man 5 sshd_config.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SSH Help - How to limit concurrent logins by a user brokenpromises Linux - Server 4 03-29-2009 03:03 AM
How to logoff the remote ssh session of a user after a certain idle time. ashishshukla Linux - Server 3 10-07-2008 08:57 AM
How to run a program in an ssh session that will run after you close out the session? dr_zayus69 Linux - Networking 5 03-05-2006 07:15 PM
idle session timeouts rhelpm Linux - Networking 4 11-25-2005 03:46 AM
logout gnome if the session is idle? yenonn Linux - Newbie 0 10-07-2004 12:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration