Please help me create a batch file that I want have it configured every time any user logs in to my personal computer (there are couple of non-admin non-root users) Another concern is that this should run invisible, i.e. no prompts, etc.

I want to have this command run invisibly at every user login to my PC : sudo iptables -A OUTPUT -p tcp -m owner --uid-owner anotheruser -j DROP

Basically, this command stops internet access for this user 'anotheruser'. And I want to have this command run every time this (or any other user) logs in to my PC.

link|improve this question
feedback

1 Answer

If you didn't need it to run as root, you'd be best to write it as a script and put it in /etc/profile.d/. profile.d scripts are executed on login. However, since you need it to run as root invisibly, you'd probably either need to:

  • Make a daemon to do it
  • Have root run a while loop for user logins

There's probably some other ways too.

link|improve this answer
thanks for your reply, but you are talking to a noob here (sorry). Can you give me any directions on these, any sites probably which can help on these two options. – whizkid Feb 1 '11 at 10:41
feedback

Your Answer

 
or
required, but never shown

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