Connect to Wi-Fi on GNU/Linux (terminal)

Disclaimer: The document author has published this document with the hope that it may be helpful to others. However, the author does not guarantee that all information contained in this document is correct or accurate. There is no warranty, expressed or implied, of merchantability or fitness for any purpose. The author does not assume any liability or responsibility for using the information contained in this document.

Date created: Dec 25 2021

Why?

Commands

Make sure you can run all these commands before you get started.

Main

sudo rfkill unblock wifi
sudo ip link set wlan0 up
sudo iw dev wlan0 scan | grep SSID
wpa_passphrase "Huynh Van Tai" "hanxinhdep" > xxx.conf
sudo wpa_supplicant -c xxx.conf -i wlan0 & disown
sudo dhcpcd wlan0

This document is licensed under the Creative Commons Zero v1.0 Universal.

Examples, recipes, and other code in this document are additionally licensed under the Unlicense.