MacOS – Connect to EAP-TLS WiFi Network OS X Terminal

I am currently working as a school technician, and I am writing a shell script that will automatically configure the school’s wireless to a Mac in order to automate the multiple BYOD and employee Macs I will configure This process. This involves

>Import the security certificate into the keychain
>Insert the following settings in this dialog box to connect to the network
>Create a file called “School”
>Configure the proxy via the wpad file under “Automatic proxy configuration”
>If it’s a teacher’s laptop and they request it, please create a new location called “YouTube” and enter the proxy settings , Allow access to YouTube under “Web Proxy”

The first method I took was to import the security certificate (root certificate authority and intermediate certificate authority) through the security command. However, I realized that the first There is no way to configure the pop-up box to configure WiFi settings during the second connection (select EAP-TLS as the connection mode, certificate and insert user name). And use

networksetup -setairportnetwork en1 eduSTAR< /pre> 

Trying to make the dialog box display doesn't work. I know the hidden

airport

command, but there is no obvious way to pass This command connects to a WiFi network. Another method I can think of is to use GUI scripts via AppleScript, I tried to avoid this method because UI changes between OS versions make the scripts unusable.

Today, I discovered that I can import the .mobileconfig file into the network settings through the GUI of the network settings, and can handle everything (including wdap proxy configuration). I also found that the networksetup command has an option to import the 802.1x configuration file.

networksetup -import8021xProfiles [service path]

The import option in the network settings does not allow me to directly import the .mobileconfig file, but I can import the settings by double-clicking the file itself It turns out that the actual file is a .networkconnect file, but the point is that it doesn’t make sense, because starting from 10.7, the command is no longer supported

Use a configuration profile to install 802.1X profiles on the syst em.
** Error: This command is no longer supported.

Now, my question is as follows:

>How to pass 10.7 without using GUI scripts And later versions of OS X terminal import .networkconnect/.mobileconfig files into network settings?
>How to connect to the network after importing through the terminal?

To import the .mobileconfig command, use the /usr/bin/profiles command. networksetup is only used for Import system configuration files of 10.6 and earlier versions.

profiles -I -F filename.mobileconfig

When importing mobileconfig, it will automatically try to connect, but the configuration file ( Different from network settings) AFAIK cannot change the priority order of SSID.

This is not what you do after this, but if your Mac is a member of AD domain and has AD integrated CA, you can use The mactls shell script automatically issues certificates and connection configuration files. It may also be a useful method of comparing system configuration files between 10.6 and 10.7.

http://sourceforge.net/p/mactls /

I am currently working as a school technician, and I am writing a shell script that will automatically configure the school wireless as a Mac in order to configure multiple BYODs for me Automate this process with employee Macs. This involves

>Import the security certificate into the keychain
>Insert the following settings in this dialog box to connect to the network
>Create one A new network location named "School"
>Configure the proxy through the wpad file under "Automatic proxy configuration"
>If it’s a teacher’s laptop and they request it, please create a new one named "YouTube" Location and enter the proxy settings to allow access to YouTube under "Web Proxy"

The first method I took is to import the security certificate (root certificate authority and intermediate certificate authority) through the security command. However, I realized that there is no way to configure the pop-up box to configure WiFi settings when I connect for the first time (select EAP-TLS as the connection mode, certificate and insert username). And use

networksetup -setairportnetwork en1 eduSTAR

Trying to make the dialog box display does not work. I know the hidden

airport

command, but There is no obvious way to connect to the WiFi network via this command. Another way I can think of is to use GUI scripts via AppleScript, I tried to avoid this method because the OS version The UI changes between this make the script unusable.

Today, I found that I can import the .mobileconfig file into the network settings through the GUI of the network settings, and can handle everything (including wdap proxy configuration), I also found that the networksetup command has an option to import 802.1x configuration files.

networksetup -import8021xProfiles [service path]

Import options in network settings I am not allowed to directly import the .mobileconfig file, but I can import the settings by double-clicking the file itself. It turns out that the actual file is a .networkconnect file, but the point is that it doesn’t make sense, because the commands are no longer supported since 10.7.

< p>

Use a configuration profile to install 802.1X profiles on the system.
** Error: This command is no longer supported.

Now, my question is as follows :

>How to import .networkconnect/.mobileconfig files into network settings through OS X terminal of 10.7 and higher without using GUI scripts?
>How to connect to the network after importing through the terminal?

To import the .mobileconfig command, use the /usr/bin/profiles command. networksetup is only used to import system configuration files of 10.6 and earlier versions. < p>

profiles -I -F filename.mobileconfig

When importing mobileconfig, it will automatically try to connect, but the profile (different from the network settings) AFAIK cannot change the priority of the SSID Order.

This is not what you do after this, but if your Mac is a member of the AD domain and has an AD integrated CA, you can use the mactls shell script to automatically issue the certificate as well as the connection profile. It It may also be a useful method of comparing system configuration files between 10.6 and 10.7.

http://sourceforge.net/p/mactls/

Leave a Comment

Your email address will not be published.