Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Remote Control Your DHCP Connected Laptop from Your iPad' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Remote Control Your DHCP Connected Laptop from Your iPad
Authored by: arcticmac on Feb 14, '11 08:45:17AM

A security note here: you want to make sure that the script that you're planning to have automatically executed with root permissions is not world writable - if it is, anyone who can access your machine a little bit can easily do anything they want, since all they have to do is edit your script and then wait 10 minutes for crond to execute it with root permissions. Maybe you don't care for your setup, but since you're posting instructions for other people, it's worth at least mentioning; it doesn't take all that long to do a <code>sudo chown root:wheel scriptname</code>.

Also, are you sure you need to be logged in for it to work with your user's permissions? I can't actually think why that should need to be the case?

Another thing to consider would be doing this via launchd. It can probably be setup to trigger running your script only when the network setup actually changes, which is a nice thing for all the reasons that event-driven code is better than polling.

[ Reply to This | # ]
Remote Control Your DHCP Connected Laptop from Your iPad
Authored by: macsadmn on Feb 14, '11 09:08:50AM

arcticmac, good catch on the security of the script. I neglected to mention that; thanks for pointing it out. I'm not entirely sure about the script running as a non-root user when no one is not logged in. I think I tested it, but it's been quite some time since I implement this. It may be worth looking into.

As for the launchd suggestion... that crossed my mind in the exact way you mentioned, but I am not familiar enough with launchd to make it happen. I was secretly hoping that someone might know more about launchd than me and post a way to do that. But, you've now forced the secret, hidden agenda, out of me. ;-)

[ Reply to This | # ]