快轉到主要內容

Ubuntu 使用指令連接 Wifi

·492 字
Computer-Science Wi-Fi
目錄

用習慣了 Desktop 版本的 Ubuntu,到 command line 卻不會用指令連接 Wifi!


注意
#

以下指令可能會需要 root 權限。


nmcli
#

1nmcli dev wifi connect <SSID> password <PASS>

把上方的「<SSID>」與「<PASS>」更換成 Wifi 的 SSID 與密碼。
若 Wifi 沒有設置密碼,則不需要設定 password:nmcli dev wifi connect <SSID>

日後若是要連接,則不用重複輸入密碼:

1nmcli con up <SSID>

ifconfig & iwconfig
#

首先先啟動網卡(將下方的 <NIC> 換成無線網卡名稱):

1ifconfig <NIC> up

例如我的網卡叫做「wlp1s0」,則:

1ifconfig wlp1s0 up

如果不知道自己的網卡名稱,可以透過指令查看:

1ifconfig

然後尋找無線網卡,通常會以「wl」開頭(但不一定)。

接著嘗試用該網卡掃描 Wifi:

1iwlist <NIC> scan

連接 Wifi:

1iwconfig <NIC> essid <SSID> key s:<PASS>

更改上方的「<NIC>」為網卡名稱;「<SSID>」為 Wifi SSID;「<PASS>」為密碼。
(p.s. 密碼前方注意加上「s:」)


References
#

Alpaca
作者
Alpaca
No one can stop my feet.

相關文章

Raspberry Pi 4 (Ubuntu) configure auto connect to wifi
·142 字
Computer-Science Raspberry PI Wi-Fi Ubuntu

How to make ubuntu auto connect to wifi in raspberry pi 4?

git diff 顯示一堆「^M」?
·1401 字
Computer-Science Git

在不同 OS 底下共同編輯一個 git repository 時,可能就會出現這個問題,要解決該問題其實也很簡單,其原理及解決方法敬請聽我娓娓道來。

Change username and home folder in ubuntu
·189 字
Computer-Science Ubuntu
Set nginx access password
·353 字
Computer-Science Nginx

How to make nginx website require password to access ?

Linux 常見壓縮指令整理
·279 字
Computer-Science

How to use compress file commands in linux ?

《Pwn - 0x03》Tools - GDB, Pwntools
·2054 字
Computer-Science Pwn