Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.