LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   SSH concurrent session limit and idle session time out (https://www.linuxquestions.org/questions/linux-newbie-8/ssh-concurrent-session-limit-and-idle-session-time-out-720320/)

lasygsd 04-19-2009 11:32 PM

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

centralb 04-20-2009 12:57 AM

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.

lasygsd 04-21-2009 10:11 PM

Quote:

Originally Posted by centralb (Post 3514708)
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

DontBeWindows 10-30-2014 07:56 AM

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

Quote:

Originally Posted by lasygsd (Post 3514665)
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.


All times are GMT -5. The time now is 03:04 AM.