-
操作方法
-
wpa_supplicant.conf文件编辑
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
在wpa_supplicant.conf文件中添加:
country=CN
ctrl_interface=DIR= /var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="WiFi名称"
psk="WiFi密码"
key_mgmt=WPA-PSK
priority=1
}
-
interfaces编辑
cd /etc/network
sudo nano /etc/network/interfaces
在文件的末尾添加
auto lo
iface lo inet loopback
iface eth0 inet dhcp
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-ssid "WiFi名称"
wpa-psk "WiFi密码"
-
最后重启就可以了
sudo reboot