diff --git a/README.md b/README.md index 92700c4..b8a363f 100644 --- a/README.md +++ b/README.md @@ -406,3 +406,557 @@ A useful command is to view the status of the system policy assesments: $ /usr/sbin/spctl --status assessments enabled ``` + +## networksetup + +Network setup is pretty much everything network-related minus some wireless stuff. + +```text +$ /usr/sbin/networksetup +networksetup Help Information +------------------------------- +Usage: networksetup -listnetworkserviceorder + Display services with corresponding port and device in order they are tried for connecting + to a network. An asterisk (*) denotes that a service is disabled. + +Usage: networksetup -listallnetworkservices + Display list of services. An asterisk (*) denotes that a network service is disabled. + +Usage: networksetup -listallhardwareports + Display list of hardware ports with corresponding device name and ethernet address. + +Usage: networksetup -detectnewhardware + Detect new network hardware and create a default network service on the hardware. + +Usage: networksetup -getmacaddress + Display ethernet (or Wi-Fi) address for hardwareport or device specified. + +Usage: networksetup -getcomputername + Display the computer name. + +Usage: networksetup -setcomputername + Set the computer's name (if valid) to . + +Usage: networksetup -getinfo + Display IPv4 address, IPv6 address, subnet mask, + router address, ethernet address for . + +Usage: networksetup -setmanual + Set the TCP/IP configuration to manual with IP address set to ip, + Subnet Mask set to subnet, and Router address set to router. + +Usage: networksetup -setdhcp [clientid] + Set the TCP/IP configuration to DHCP. You can set the + DHCP client id to the optional [clientid]. Specify "Empty" for [clientid] + to clear the DHCP client id. + +Usage: networksetup -setbootp + Set the TCP/IP configuration to BOOTP. + +Usage: networksetup -setmanualwithdhcprouter + Set the TCP/IP configuration to manual with DHCP router with IP address set + to ip. + +Usage: networksetup -getadditionalroutes + Get additional IPv4 routes associated with +Usage: networksetup -setadditionalroutes [ ]* + Set additional IPv4 routes associated with + by specifying one or more [ ] tuples. + Remove additional routes by specifying no arguments. + If is "", the route is direct to the interface +Usage: networksetup -setv4off + Turn IPv4 off on . + +Usage: networksetup -setv6off + Turn IPv6 off on . + +Usage: networksetup -setv6automatic + Set the service to get its IPv6 info automatically. + +Usage: networksetup -setv6LinkLocal + Set the service to use its IPv6 only for link local. + +Usage: networksetup -setv6manual
+ Set the service to get its IPv6 info manually. + Specify
and . + +Usage: networksetup -getv6additionalroutes + Get additional IPv6 routes associated with +Usage: networksetup -setv6additionalroutes [ ]* + Set additional IPv6 routes associated with + by specifying one or more [ ] tuples. + Remove additional routes by specifying no arguments. + If is "", the route is direct to the interface +Usage: networksetup -getdnsservers + Display DNS info for . + +Usage: networksetup -setdnsservers [dns2] [...] + Set the DNS servers to [dns2] [...]. Any number of dns servers can be + specified. Specify "Empty" for to clear all DNS entries. + +Usage: networksetup -getsearchdomains + Display Domain Name info for . + +Usage: networksetup -setsearchdomains [domain2] [...] + Set the Domain Name servers to [domain2] [...]. Any number of Domain Name + servers can be specified. Specify "Empty" for to clear all Domain Name entries. + +Usage: networksetup -create6to4service + Create a 6 to 4 service with name . + +Usage: networksetup -set6to4automatic + Set the service to get its 6 to 4 info automatically. + +Usage: networksetup -set6to4manual + Set the service to get its 6 to 4 info manually. + Specify for the relay address. + +Usage: networksetup -getftpproxy + Display FTP proxy (server, port, enabled value) info for . + +Usage: networksetup -setftpproxy + Set FTP proxy for with and . Turns proxy on. Optionally, specify or for to enable and disable authenticated proxy support. Specify and if you turn authenticated proxy support on. + +Usage: networksetup -setftpproxystate + Set FTP proxy to either or . + +Usage: networksetup -getwebproxy + Display Web proxy (server, port, enabled value) info for . + +Usage: networksetup -setwebproxy + Set Web proxy for with and . Turns proxy on. Optionally, specify or for to enable and disable authenticated proxy support. Specify and if you turn authenticated proxy support on. + +Usage: networksetup -setwebproxystate + Set Web proxy to either or . + +Usage: networksetup -getsecurewebproxy + Display Secure Web proxy (server, port, enabled value) info for . + +Usage: networksetup -setsecurewebproxy + Set Secure Web proxy for with and . Turns proxy on. Optionally, specify or for to enable and disable authenticated proxy support. Specify and if you turn authenticated proxy support on. + +Usage: networksetup -setsecurewebproxystate + Set SecureWeb proxy to either or . + +Usage: networksetup -getstreamingproxy + Display Streaming proxy (server, port, enabled value) info for . + +Usage: networksetup -setstreamingproxy + Set Streaming proxy for with and . Turns proxy on. Optionally, specify or for to enable and disable authenticated proxy support. Specify and if you turn authenticated proxy support on. + +Usage: networksetup -setstreamingproxystate + Set Streaming proxy to either or . + +Usage: networksetup -getgopherproxy + Display Gopher proxy (server, port, enabled value) info for . + +Usage: networksetup -setgopherproxy + Set Gopher proxy for with and . Turns proxy on. Optionally, specify or for to enable and disable authenticated proxy support. Specify and if you turn authenticated proxy support on. + +Usage: networksetup -setgopherproxystate + Set Gopher proxy to either or . + +Usage: networksetup -getsocksfirewallproxy + Display SOCKS Firewall proxy (server, port, enabled value) info for . + +Usage: networksetup -setsocksfirewallproxy + Set SOCKS Firewall proxy for with and . Turns proxy on. Optionally, specify or for to enable and disable authenticated proxy support. Specify and if you turn authenticated proxy support on. + +Usage: networksetup -setsocksfirewallproxystate + Set SOCKS Firewall proxy to either or . + +Usage: networksetup -getproxybypassdomains + Display Bypass Domain Names for . + +Usage: networksetup -setproxybypassdomains [domain2] [...] + Set the Bypass Domain Name Servers for to [domain2] [...]. Any number of + Domain Name servers can be specified. Specify "Empty" for to clear all + Domain Name entries. + +Usage: networksetup -getproxyautodiscovery + Display whether Proxy Auto Discover is on or off for . + +Usage: networksetup -setproxyautodiscovery + Set Proxy Auto Discovery to either or . + +Usage: networksetup -getpassiveftp + Display whether Passive FTP is on or off for . + +Usage: networksetup -setpassiveftp + Set Passive FTP to either or . + +Usage: networksetup -setautoproxyurl + Set proxy auto-config to url for and enable it. + +Usage: networksetup -getautoproxyurl + Display proxy auto-config (url, enabled) info for . + +Usage: networksetup -setautoproxystate + Set proxy auto-config to either or . + +Usage: networksetup -getairportnetwork + Display current Wi-Fi Network for . + +Usage: networksetup -setairportnetwork [password] + Set Wi-Fi Network to for . + If a password is included, it gets stored in the keychain. + +Usage: networksetup -getairportpower + Display whether Wi-Fi power is on or off for . + +Usage: networksetup -setairportpower + Set Wi-Fi power for to either or . + +Usage: networksetup -listpreferredwirelessnetworks + List the preferred wireless networks for . + +Usage: networksetup -addpreferredwirelessnetworkatindex [password] + Add wireless network named to preferred list for at . + For security type, use OPEN for none, WPA for WPA Personal, WPAE for WPA Enterprise, + WPA2 for WPA2 Personal, WPA2E for WPA2 Enterprise, WEP for plain WEP, and 8021XWEP for 802.1X WEP. + If a password is included, it gets stored in the keychain. + +Usage: networksetup -removepreferredwirelessnetwork + Remove from the preferred wireless network list for . + +Usage: networksetup -removeallpreferredwirelessnetworks + Remove all networks from the preferred wireless network list for . + +Usage: networksetup -getnetworkserviceenabled + Display whether a service is on or off (enabled or disabled). + +Usage: networksetup -setnetworkserviceenabled + Set to either or (enabled or disabled). + +Usage: networksetup -createnetworkservice + Create a service named on port . The new service will be enabled by default. + +Usage: networksetup -renamenetworkservice + Rename to . + +Usage: networksetup -duplicatenetworkservice + Duplicate and name it with . + +Usage: networksetup -removenetworkservice + Remove the service named . Will fail if this is the only service on the hardware port that is on. + +Usage: networksetup -ordernetworkservices <...> + Order the services in order specified. Use "-listnetworkserviceorder" to view service order. + Note: use quotes around service names which contain spaces (ie. "Built-in Ethernet"). + +Usage: networksetup -setMTUAndMediaAutomatically + Set hardwareport or device specified back to automatically setting the MTU and Media. + +Usage: networksetup -getMTU + Get the MTU value for hardwareport or device specified. + +Usage: networksetup -setMTU + Set MTU for hardwareport or device specified. + +Usage: networksetup -listvalidMTUrange + List the valid MTU range for hardwareport or device specified. + +Usage: networksetup -getmedia + Show both the current setting for media and the active media on hardwareport or device specified. + +Usage: networksetup -setmedia [option1] [option2] [...] + Set media for hardwareport or device specified to subtype. Specify optional [option1] and additional options depending on subtype. Any number of valid options can be specified. + +Usage: networksetup -listvalidmedia + List valid media options for hardwareport or device name. Enumerates available subtypes and options per subtype. + +Usage: networksetup -createVLAN + Create a VLAN with name over device with unique tag . A default network service will be created over the VLAN. + +Usage: networksetup -deleteVLAN + Delete the VLAN with name over the parent device with unique tag . If there are network services running over the VLAN they will be deleted. + +Usage: networksetup -listVLANs + List the VLANs that have been created. + +Usage: networksetup -listdevicesthatsupportVLAN + List the devices that support VLANs. + +Usage: networksetup -isBondSupported + Return YES if the specified device can be added to a bond. NO if it cannot. + +Usage: networksetup -createBond <...> + Create a new bond and give it the user defined name. Add the specified devices, if any, to the bond. + +Usage: networksetup -deleteBond + Delete the bond with the specified device-name. + +Usage: networksetup -addDeviceToBond + Add the specified device to the specified bond. + +Usage: networksetup -removeDeviceFromBond + Remove the specified device from the specified bond + +Usage: networksetup -listBonds + List all of the bonds. + +Usage: networksetup -showBondStatus + Display the status of the specified bond. + +Usage: networksetup -listpppoeservices + List all of the PPPoE services in the current set. + +Usage: networksetup -showpppoestatus + Display the status of the specified PPPoE service. + +Usage: networksetup -createpppoeservice [pppoe service name] + Create a PPPoE service on the specified device with the service name specified. + The "pppoe service name" is optional and may not be supported by the service provider. + +Usage: networksetup -deletepppoeservice + Delete the PPPoE service. + +Usage: networksetup -setpppoeaccountname + Sets the account name for the specified service. + +Usage: networksetup -setpppoepassword + Sets the password stored in the keychain for the specified service. + +Usage: networksetup -connectpppoeservice + Connect the PPPoE service. + +Usage: networksetup -disconnectpppoeservice + Disconnect the PPPoE service. + +Usage: networksetup -getcurrentlocation + Display the name of the current location. + +Usage: networksetup -listlocations + List all of the locations. + +Usage: networksetup -createlocation [populate] + Create a new network location with the spcified name. + If the optional term "populate" is included, the location will be populated with the default services. + +Usage: networksetup -deletelocation + Delete the location. + +Usage: networksetup -switchtolocation + Make the specified location the current location. + +Usage: networksetup -listalluserprofiles + Display the names of all of the user profiles. + +Usage: networksetup -listloginprofiles + Display the names of the loginwindow profiles for the specified service. + +Usage: networksetup -enablesystemprofile + Enables or disables the system profile for the specified service. + +Usage: networksetup -enableloginprofile + Enables or disables the specified loginwindow profile for the specified service. + +Usage: networksetup -enableuserprofile + Enables or disables the specified user profile. + +Usage: networksetup -import8021xProfiles + Imports the 802.1x profiles for the specified service. + +Usage: networksetup -export8021xProfiles + Exports all of the profiles for the specified service. + If the last parameter is yes, it will include the items from the keychain. + +Usage: networksetup -export8021xUserProfiles + Exports only the user profiles. + + If the last parameter is yes, it will include the items from the keychain. + +Usage: networksetup -export8021xLoginProfiles + Exports only the loginwindow profiles for the specified service. + + If the last parameter is yes, it will include the items from the keychain. + +Usage: networksetup -export8021xSystemProfile + Exports only the system profile for the specified service. + + If the last parameter is yes, it will include the items from the keychain. + +Usage: networksetup -settlsidentityonsystemprofile + Sets the TLS identity on the system profile for the specified service. + + The identity must be a pkcs12 file. + +Usage: networksetup -settlsidentityonuserprofile + Sets the TLS identity on the specified user profile. + + The identity must be a pkcs12 file. + +Usage: networksetup -deletesystemprofile + Deletes the system profile for the specified service. + +Usage: networksetup -deleteloginprofile + Deletes the specified loginwindow profile for the specified service. + +Usage: networksetup -deleteuserprofile + Deletes the specified user profile. + +Usage: networksetup -version + Display version of networksetup tool. + +Usage: networksetup -help + Display these help listings. + +Usage: networksetup -printcommands + Displays a quick listing of commands (without explanations). + +Any command that takes a password, will accept - to indicate the password should be read from stdin. +``` + +## systemsetup + +This utility provides a lot of simpler system setup options. + +```text +$ sudo /usr/sbin/systemsetup +systemsetup Help Information +------------------------------------- +Usage: systemsetup -getdate + Display current date. + +Usage: systemsetup -setdate + Set current date to . + +Usage: systemsetup -gettime + Display current time. + +Usage: systemsetup -settime + Set current time to . + +Usage: systemsetup -gettimezone + Display current time zone. + +Usage: systemsetup -settimezone + Set current time zone to . Use "-listtimezones" to list time zones. + +Usage: systemsetup -listtimezones + List time zones supported by this machine. + +Usage: systemsetup -getusingnetworktime + Display whether network time is on or off. + +Usage: systemsetup -setusingnetworktime + Set using network time to either or . + +Usage: systemsetup -getnetworktimeserver + Display network time server. + +Usage: systemsetup -setnetworktimeserver + Set network time server to . + +Usage: systemsetup -getsleep + Display amount of idle time until computer, display and hard disk sleep. + +Usage: systemsetup -setsleep + Set amount of idle time until computer, display and hard disk sleep to . + Specify "Never" or "Off" for never. + +Usage: systemsetup -getcomputersleep + Display amount of idle time until computer sleeps. + +Usage: systemsetup -setcomputersleep + Set amount of idle time until compputer sleeps to . + Specify "Never" or "Off" for never. + +Usage: systemsetup -getdisplaysleep + Display amount of idle time until display sleeps. + +Usage: systemsetup -setdisplaysleep + Set amount of idle time until display sleeps to . + Specify "Never" or "Off" for never. + +Usage: systemsetup -getharddisksleep + Display amount of idle time until hard disk sleeps. + +Usage: systemsetup -setharddisksleep + Set amount of idle time until hard disk sleeps to . + Specify "Never" or "Off" for never. + +Usage: systemsetup -getwakeonmodem + Display whether wake on modem is on or off. + +Usage: systemsetup -setwakeonmodem + Set wake on modem to either or . + +Usage: systemsetup -getwakeonnetworkaccess + Display whether wake on network access is on or off. + +Usage: systemsetup -setwakeonnetworkaccess + Set wake on network access to either or . + +Usage: systemsetup -getrestartpowerfailure + Display whether restart on power failure is on or off. + +Usage: systemsetup -setrestartpowerfailure + Set restart on power failure to either or . + +Usage: systemsetup -getrestartfreeze + Display whether restart on freeze is on or off. + +Usage: systemsetup -setrestartfreeze + Set restart on freeze to either or . + +Usage: systemsetup -getallowpowerbuttontosleepcomputer + Display whether the power button is able to sleep the computer. + +Usage: systemsetup -setallowpowerbuttontosleepcomputer + Enable or disable whether the power button can sleep the computer. + +Usage: systemsetup -getremotelogin + Display whether remote login is on or off. + +Usage: systemsetup -setremotelogin + Set remote login to either or . Use "systemsetup -f -setremotelogin off" to suppress prompting when turning remote login off. Requires Full Disk Access privileges. + +Usage: systemsetup -getremoteappleevents + Display whether remote apple events are on or off. + +Usage: systemsetup -setremoteappleevents + Set remote apple events to either or . Requires Full Disk Access privileges. + +Usage: systemsetup -getcomputername + Display computer name. + +Usage: systemsetup -setcomputername + Set computer name to . + +Usage: systemsetup -getlocalsubnetname + Display local subnet name. + +Usage: systemsetup -setlocalsubnetname + Set local subnet name to . + +Usage: systemsetup -getstartupdisk + Display current startup disk. + +Usage: systemsetup -setstartupdisk + Set current startup disk to . + +Usage: systemsetup -liststartupdisks + List startup disks on this machine. + +Usage: systemsetup -getwaitforstartupafterpowerfailure + Get the number of seconds after which the computer will start up after a power failure. + +Usage: systemsetup -setwaitforstartupafterpowerfailure + Set the number of seconds after which the computer will start up after a power failure. The value must be a multiple of 30 seconds. + +Usage: systemsetup -getdisablekeyboardwhenenclosurelockisengaged + Get whether or not the keyboard should be disabled when the X Serve enclosure lock is engaged. + +Usage: systemsetup -setdisablekeyboardwhenenclosurelockisengaged + Set whether or not the keyboard should be disabled when the X Serve enclosure lock is engaged. + +Usage: systemsetup -version + Display version of systemsetup tool. + +Usage: systemsetup -help + Display help. + +Usage: systemsetup -printCommands + Display commands. +```