Mac OSX chflag lock file

Lock

sudo chflags schg /Library/Preferences/SystemConfiguration/preferences.plist

Unlock

sudo chflags noschg  /Library/Preferences/SystemConfiguration/preferences.plist