0

Is posible to limit user login using iptables? It's like if one user is logged in, no one else can log in using that user.

I try this command:

iptables -A INPUT -p tcp --syn --dport 22 -m connlimit --connlimit-above 1 -j REJECT

It can limit user login, but just for 1 IP. I still can login using another PC with different IP Address.

Thank you

1 Answer 1

1

No, it's not possible. Iptables has no way to tell if two different ssh connections come from the same user or from different users. Look at this answer in unix.stackexchange.com for the correct way to restrict multiple ssh logins from the same user, using sshd configuration rather than iptables.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .