Scrawls from Preston...

Powered by Pelican.

Wed 28 October 2009

Restricting login to account based on IP address

At work we needed to have a standard local account that would work off campus, but not on campus. Here was my solution.

First I check for the user and create it if it doesn't exist

#!bash

user_exists=`dscl . -read /Users/remote GeneratedUID | grep -c GeneratedUID`

if [ $user_exists -ne ...

https://ptone.com/dablog