hostapd Command Cheat Sheet
hostapd (Host Access Point Daemon) enables a Linux system to act as a Wi-Fi access point. It handles authentication and manages wireless configurations.
Install hostapd
sudo apt install hostapd
Sample Configuration File
Create /etc/hostapd/hostapd.conf:
interface=wlan0
driver=nl80211
ssid=MyWiFi
hw_mode=g
channel=6
auth_algs=1
wmm_enabled=1
wpa=2
wpa_passphrase=securepass123
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
Start with Config File
sudo hostapd /etc/hostapd/hostapd.conf
Enable on Boot
sudo systemctl enable hostapd
Troubleshooting
- Check logs with
journalctl -xeorsudo hostapd -dd. - Ensure
dnsmasqor DHCP is configured separately.
Notes
- Requires compatible wireless adapter and driver (e.g.,
nl80211). - Used in Raspberry Pi hotspot and embedded networking solutions.