I am building a basic captive portal script, with support for idle timeout. I managed to create iptables rules on authentication in the browser.

However, I'm not sure how to detect users that are active, and users that are idle for a certain amount of time. e.g When a user is not active for 30 minutes, he needs to be logged out.

What could be a good way to know if a user is idle?

link|improve this question
feedback

1 Answer

You can check out the inactivity time (idle time) with command w -hfs along with a bunch of other info.

link|improve this answer
This command shows the activity of users logged in on the local system, however captive portals don't use local logins. A user is just connected by the network. – Christophe B. Jan 2 at 11:23
feedback

Your Answer

 
or
required, but never shown

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