I have a iMac running 10.6 where I have been tasked with creating two different users who can use different network profiles(locations).
User 1 will be connecting via Ethernet through a filtered network, all other connections are disabled, which works fine.
User 2 needs to connect to the unfiltered Wi-Fi but no access to any other connections.
I have most of this implemented in Network Locations, the problem is that both of these locations are available to both Users.
What I'd like to be able to do is assign the customized Location as a Default for each user.
From a security standpoint it isn't perfect, but if I can get this sort of thing working, I'd like to assign the Wi-Fi connection to the guest user, so they can navigate without the filters. Then the Regular user will have Ethernet, and will not be able to switch Locations, or enable Wi-Fi.
The trick with this is that the User will be a single user. They will know both user passwords, they will just need to switch users to perform different tasks.
Is it possible with plain OSX, or will I need external software/scripts?
Best Answer
Well, I cracked it, it wasn't loginHooks I needed, but launchctl.
Basically, create two scripts (executable of course, you can make em root only too):
User1.sh
User2.sh
These of course make the assumption you're using an imac, en0 is the enthernet, en1 is the WiFi.
Then create a plist file (with root ownership, 644), mine was this:
User1's went in /Users/user1/Library/LaunchAgents/org.user1.plist
User2's in /Users/user2/Library/LaunchAgents/org.user2.plist
After that run
and
as each user.
That's it, it's quick, simple, and if you set the owner of the scripts as someone else (and on another path), it's fairly secure (not bulletproof, but that's not in my scope at the moment).