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?


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

  • 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 '12 at 11:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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