加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – iwconfig – 通过wifi在终端上连接网络

发布时间:2020-12-13 19:50:27 所属栏目:Linux 来源:网络整理
导读:在树莓上 irukeru@raspberrypi ~ $sudo iwconfig wlan0 mode managedirukeru@raspberrypi ~ $sudo iwconfig wlan0 channel 11irukeru@raspberrypi ~ $sudo iwconfig wlan0 essid linksysirukeru@raspberrypi ~ $sudo iwconfig wlan0 key xxxxxxxError for wi
在树莓上
irukeru@raspberrypi ~ $sudo iwconfig wlan0 mode managed
irukeru@raspberrypi ~ $sudo iwconfig wlan0 channel 11
irukeru@raspberrypi ~ $sudo iwconfig wlan0 essid linksys
irukeru@raspberrypi ~ $sudo iwconfig wlan0 key xxxxxxx
Error for wireless request "Set Encode" (8B2A) :
    invalid argument "xxxxxxx".

我也试过

irukeru@raspberrypi ~ $sudo iwconfig wlan0 key s:xxxxxxx
Error for wireless request "Set Encode" (8B2A) :
    SET failed on device wlan0 ; Invalid argument.

我是否需要编写我的密钥的bash代码?

解决方法

从 man iwconfig

key/enc[ryption]
Used to manipulate encryption or scrambling keys and security mode.
To set the current encryption key,just enter the key in hex digits as XXXX-XXXX-XXXX-XXXX or XXXXXXXX. To set a key other than the current key,prepend or append [index] to the key itself (this won’t change which is the active key). You can also enter the key as an ASCII string by using the s: prefix. Passphrase is currently not supported.

HBAQXK7W6Y不是十六进制键.如果这是ascii键,我想你应该输入它

sudo iwconfig wlan0 key s:HBAQXK7W6Y

但是,如果这真的是您的WLAN的关键,您应该尽快更改.不要在公共网站上张贴密码.

更新:

在https://superuser.com/q/42460/164903有一个类似的问题.我认为,特别是这个答案https://superuser.com/a/353818/164903很重要.看来,iwconfig不支持WPA / WPA2,只有未加密的网络或WEP,这与现在基本相同.所以你需要使用一些其他的方法,比如wpa_supplicant.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读