linux连接隐藏网络,如何使用nmcli连接到隐藏的wifi网络

I have to write a linux desktop software which connects to a hidden wifi network. If the network is not hidden, my code can connect by calling nmcli, but if it is hidden, it can not add the connection. However, I can create a new network using the GUI of the Network Manager, so I think it is not impossible. Do you have any ideas?

我必须编写一个连接到隐藏的wifi网络的Linux桌面软件。如果网络没有隐藏,我的代码可以通过调用nmcli进行连接,但如果它被隐藏,则无法添加连接。但是,我可以使用网络管理器的GUI创建一个新网络,所以我认为这并非不可能。你有什么想法?

3 个解决方案

#1

13

Okay, I have the solution. We know the ssid and the password.

好的,我有解决方案。我们知道ssid和密码。

nmcli c add type wifi con-name ifname wlan0 ssid

nmcli con modify wifi-sec.key-mgmt wpa-psk

nmcli con modify wifi-sec.psk

nmcli con up

If we dont need the connection anymore:

如果我们不再需要连接:

nmcli c delete

#2

4

This works fine for me:

这对我来说很好:

nmcli dev wifi connect "abc" password 123 hidden yes

#3

-1

While doing some experimenting, I found that you can use both echnotux's and Pocokman's answers to get it to connect. i.e

在进行一些实验时,我发现你可以使用echnotux和Pocokman的答案来连接它。即

nmcli c add type wifi con-name ifname wlan0 ssid

nmcli dev wifi connect password hidden yes

nmcli c delete

This simplifies it quite a bit.

这简化了它。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值