Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I manage a large group of macs and they are all connected via ethernet. I would like to disable wifi on them and then require and administrator to change any wifi settings (pretty much what is shown in the picture below) enter image description here Since I manage so many, I would like to push out the setting via remote desktop manager. Is there a command line for these settings? I know that turning off wifi is networksetup -setairportpower en1 off but I cant seem to find the settings to require admin privileges.

share|improve this question
    
I did find one command that lets me disable the hardware altogether and seems to require an administrator to renable. Maybe someone can confirm networksetup -setnetworkserviceenabled 'Airport' off –  Brian Mar 7 '12 at 21:48
    
I'm not sure why this has close votes? It appears to be about a admining desktops in a professional enviroment –  Jacob Mar 11 '12 at 4:43
add comment

1 Answer

up vote 6 down vote accepted

The solution lies with the less well-known command line tool airport, which is found in /usr/sbin/ under Lion and Snow Leopard (and therefore may already be in your PATH), but was hidden in /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/ on Leopard, IIRC.

In this case, the command you want to issue is the following:

sudo airport en1 prefs RequireAdmin=YES

The man page is practically empty and issuing airport --help actually gives you less usage information than issuing the command without any arguments. The latter gives the following explanation:

Usage: airport <interface> <verb> <options>

  <interface>
  If an interface is not specified, airport will use the first AirPort interface on the system.

  <verb is one of the following:
  prefs   If specified with no key value pairs, displays a subset of AirPort preferences for
      the specified interface.

      Preferences may be configured using key=value syntax. Keys and possible values are specified below.
      Boolean settings may be configured using 'YES' and 'NO'.

      DisconnectOnLogout (Boolean)
      JoinMode (String)
          Automatic
          Preferred
          Ranked
          Recent
          Strongest
      JoinModeFallback (String)
          Prompt
          JoinOpen
          KeepLooking
          DoNothing
      RememberRecentNetworks (Boolean)
      RequireAdmin (Boolean)
      RequireAdminIBSS (Boolean)
      RequireAdminNetworkChange (Boolean)
      RequireAdminPowerToggle (Boolean)
      WoWEnabled (Boolean)

  logger  Monitor the driver's logging facility.

  sniff   If a channel number is specified, airportd will attempt to configure the interface
      to use that channel before it begins sniffing 802.11 frames. Captures files are saved to /tmp.
      Requires super user privileges.

  debug   Enable debug logging. A debug log setting may be enabled by prefixing it with a '+', and disabled
      by prefixing it with a '-'.

      AirPort Userland Debug Flags
          DriverDiscovery
          DriverEvent
          Info
          SystemConfiguration
          UserEvent
          PreferredNetworks
          AutoJoin
          IPC
          Scan
          802.1x
          Assoc
          Keychain
          RSNAuth
          WoW
          P2P
          Roam
          BTCoex
          AllUserland - Enable/Disable all userland debug flags

      AirPort Driver Common Flags
          DriverInfo
          DriverError
          DriverWPA
          DriverScan
          AllDriver - Enable/Disable all driver debug flags

      AirPort Driver Vendor Flags
          VendorAssoc
          VendorConnection
          AllVendor - Enable/Disable all vendor debug flags

      AirPort Global Flags
          LogFile - Save all AirPort logs to /var/log/wifi.log

<options> is one of the following:
  No options currently defined.

Examples:

Configuring preferences (requires admin privileges)
  sudo airport en1 prefs JoinMode=Preferred RememberRecentNetworks=NO RequireAdmin=YES

Sniffing on channel 1:
  airport en1 sniff 1


LEGACY COMMANDS:
Supported arguments:
 -c[<arg>] --channel=[<arg>]    Set arbitrary channel on the card
 -z        --disassociate       Disassociate from any network
 -I        --getinfo            Print current wireless status, e.g. signal info, BSSID, port type etc.
 -s[<arg>] --scan=[<arg>]       Perform a wireless broadcast scan.
                 Will perform a directed scan if the optional <arg> is provided
 -x        --xml                Print info as XML
 -P        --psk                Create PSK from specified pass phrase and SSID.
                 The following additional arguments must be specified with this command:
                                  --password=<arg>  Specify a WPA password
                                  --ssid=<arg>      Specify SSID when creating a PSK
 -h        --help               Show this help
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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