Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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

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

Your Answer


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.