I made the changes in /etc/security/limits.conf
test hard maxlogins 2
sftptest hard maxlogins 2
After above entries I have tested below scenarios
- Open 2 putty sessions when I tried to open 3rd sessions it disconnect automatically (Working fine with ssh user not for sftp user )
- Open 2 putty sessions when I am trying to open 3rd session from the filezilla / winscp connection disconnected automatically (Working fine with ssh user ) 3.When I am trying to open 3 sessions in filezilla/winscp I am able to open 3 sessions ( Not working)
- when I am trying to open 3 sessions in filezilla/winscp with sftp users I am able to open all three sessions -Is there any difference in putty client and winscp/filezilla ? -SSH users having shell login but sftp users don't have shell login
Is there any chance to limit the connections 2 for sftp users?
I am pretty new to Linux.
MaxSessionorfirewall. The first will work if your ssh supports it!sudo firewall-cmd --permanent --direct --add-rule iptables -I INPUT -p TCP --dport 22 --syn -m connlimit --connlimit-above 2 -j REJECT, this only limits per ip not per user!