0

Currently I am using nmtui for selecting a spot.

I would like to connect to a wifi spot from command line.

I expect there might be a tool that would work this way

connec2wifi -s somessid -p ****

Where -s is ssid and -p is password

or even like this?

connec2wifi  somessid *****

Also, if there is no such tool. What would be the best way to implement it?

3

Since you're using nmtui, you should also have nmcli. With that you can follow the post Connect to a wireless network using command line nmcli.

Check you can see the wireless NIC and that the radio is enabled (basically “Airplane” mode):

# nmcli radio
WIFI-HW  WIFI     WWAN-HW  WWAN    
enabled  enabled  enabled  enabled 
# nmcli device
DEVICE  TYPE      STATE         CONNECTION 
wlan0   wifi      disconnected  --         
eth0    ethernet  unavailable   --         
lo      loopback  unmanaged     --  

Then to actually connect to a wireless AP:

# nmcli device wifi rescan
# nmcli device wifi list
# nmcli device wifi connect SSID-Name password wireless-password
|improve this answer|||||

Not the answer you're looking for? Browse other questions tagged or ask your own question.