Mac-Osx
通過終端進行 OS X WiFi 設置?
我管理著一大群 Mac,它們都通過乙太網連接。我想禁用他們的wifi,然後要求管理員更改任何wifi設置(幾乎如下圖所示) 因為我管理了這麼多,我想通過遠端桌面管理器推出設置。這些設置是否有命令行?我知道關閉 wifi 是
networksetup -setairportpower en1 off
,但我似乎無法找到需要管理員權限的設置。
解決方案在於不太知名的命令行工具airport。
在 Snow Leopard 之前發現
/usr/sbin
(因此可能已經在您的 PATH 中),對於較新的作業系統,可以在
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources
在這種情況下,您要發出的命令如下:
sudo airport en1 prefs RequireAdmin=YES
手冊頁實際上是空的,並且發出airport –help實際上比發出沒有任何參數的命令提供的使用資訊更少。後者給出以下解釋:
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