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

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

1 Answer 1

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

 
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.