Monday, November 20, 2017

Connecting to a Wifi SSID from the macOS command line

Sometimes it's useful to be able to connect to an SSID (or switch from one to the other) from the command line. Here is how to do this on macOS (tested on High Sierra):

networksetup -setairportnetwork [interface] [SSID] [password]

For example:

networksetup -setairportnetwork en0 SSID1
networksetup -setairportnetwork en0 SSID2
networksetup -setairportnetwork en0 MyHouseSSID MyPassword

Using this command to connect to the same SSID your already connected acts as a reconnect.

No comments:

Post a Comment

Day-O: A customizable macOS clock replacement

At work we use week number milestones. Finding which week we are in is always a pain... Until I found Day-O ( https://shauninman.com/archive...