how to restrict number of sftp connections.
Hi all,
if i want user should`t have more than 20 sftp connections to a server, is there any way we can limit no.of connections to a particular user on the server using ssh configuration. Thanks & Regards, Kiran |
From the sshd_config(5) manpages:
Quote:
|
I am getting below error if i try with Max sessions option.
any idea why ssh is failing to start? [root@zin50lte-build ~]# ssh -V OpenSSH_3.9p1, OpenSSL 0.9.7a Feb 19 2003 [root@zin50lte-build ~]# [root@zin50lte-build ~]# /etc/init.d/sshd start Starting sshd:/etc/ssh/sshd_config: line 105: Bad configuration option: MaxSessions /etc/ssh/sshd_config: terminating, 1 bad configuration options [FAILED] Thanks, Kiran |
Quote:
Quote:
That said, have you considered using iptables to limit the number of connections which can be started from the same IP? You could do it with the connlimit match using something like (example): Code:
iptables -I INPUT -p TCP --dport 22 --syn -m connlimit --connlimit-above 20 -j REJECT |
You can write custom wrapper script, who will be checking connections and their number on the SSH port, if reach max number - print some banner (connection refused : max number reached), if not - print some welcome banner.
|
Quote:
|
All times are GMT -5. The time now is 01:22 PM. |