Solved Easy way to connect to wifi router

maxmoon

Member

Reaction score: 4
Messages: 27

Hi

Is there an easier way to connect to a wifi router?

My current way looks like the following and I even don't know if it might to be like that, because it looks 'broken':
  1. Look for the SSID with: sudo ifconfig wlan0 scan
  2. Put the ssid and password in /etc/wpa_supplicant.conf
  3. Connect with the given SSID with: sudo ifconfig wlan0 ssid "the searched ssid name"
  4. Restart netif service otherwise internet will not work: sudo service netif restart
It would be very nice if there is a 'better' way, because I am travelling a lot and it just gets complicated.
 
OP
OP
M

maxmoon

Member

Reaction score: 4
Messages: 27

Ok, networkmgr doesn't work well if it's about adding new ssids. There are several problems with doas, even if I used a doas.conf, which should fit with it. I tried vermadens script then and it has issues with doas too, even if he is providing a doas.conf. So I think I stick with wifimgr, even if the software doesn't show with which router I am connected :/
 

Phishfry

Son of Beastie

Reaction score: 1,395
Messages: 4,110

I use net-mgmt/networkmgr and it is good stuff.
Perhaps you have a typo or spacing error? The package message shows only this is needed:
/usr/local/etc/doas.conf
Code:
permit nopass keepenv root
permit :wheel
permit nopass keepenv :wheel cmd netcardmgr
permit nopass keepenv :wheel cmd ifconfig
permit nopass keepenv :wheel cmd service
but you still have to edit wpa_supplicant.conf by hand.
I think it is a good idea to clear out wpa_supplicant.conf and let networkmgr handle the entries.
 
OP
OP
M

maxmoon

Member

Reaction score: 4
Messages: 27

I've changed the doas.conf and cleared the context of wpa_supplicant.conf. But it still don't work. Here is the output of networkmgr:

Code:
doas: Operation not permitted
/bin/sh: Syntax error: Unterminated quoted string
doas: Operation not permitted
Traceback (most recent call last):
  File "/usr/local/share/networkmgr/authentication.py", line 28, in add_to_wpa_supplicant
    Lock_Wpa_Supplicant(self.ssid, self.bssid, pwd, self.wificard)
  File "/usr/local/share/networkmgr/authentication.py", line 114, in __init__
    wsf = open(wpa_supplican, 'a')
PermissionError: [Errno 13] Permission denied: '/etc/wpa_supplicant.conf'
I did chmod 644 /etc/wpa_supplicant.conf. Does it need more rights?
 

Elazar

Member

Reaction score: 21
Messages: 36

Code:
wsf = open(wpa_supplican, 'a')
This calls open() with the "a" option (append text to file).
I guess it throws an exception if you make the file read-only.
 
Top