[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: which X11 app can show wifi info



On Wed 15 Jun 2022 at 09:43:50 +0300, Reco wrote:

> 	Hi.
> 
> On Wed, Jun 15, 2022 at 03:30:53AM +0200, Vincent Lefevre wrote:
> > On 2022-06-14 15:43:40 +0100, Brian wrote:
> > > On Tue 14 Jun 2022 at 13:15:56 +0200, Vincent Lefevre wrote:
> > > > No issues with iwlist and nmcli.
> > > 
> > > /usr/sbin/wpa_gui and /sbin/wpa_cli should both give sensible outputs
> > > when run as root.
> > 
> > For security reasons, I don't want to run them as root.
> 
> First example they provide in wpa_supplicant.conf(5) shows the way to
> use wpa_cli sensibly without being root.

The wpasupplicant documentation also provides a useful README.Debian.

> One just needs to define a group for wpa_supplicant's control socket, like this:
> 
> ctrl_interface=DIR=/run/wpa_supplicant GROUP=netdev
> 
> Add a user to a netdev group and you're set.

That is the first step but is not quite sufficient. The supplicant
needs to be made aware that the user is in the netdev group. Un my
/e/n/i:

  # The id_str.
  iface home inet dhcp

  # The id_str. 
  # iface home inet static
  #      address 192.168.7.55/24
  #      gateway 192.168.7.1

  allow-hotplug wlx74ea3a93adab
        iface wlx74ea3a93adab inet manual
        wpa-roam /etc/wpa_supplicant/wpasupplicant.conf

In /etc/wpa_supplicant/wpasupplicant.conf:

  ctrl_interface=DIR=/run/wpa_supplicant GROUP=netdev

  network={
  ssid="MI5_Listening_Station_#666"
  psk="Secure"
  proto=WPA
  id_str="home"
  } 
  
> > The iwlist and nmcli utilities don't need root to work correctly.
> 
> I don't know about iwlist, but nmcli uses dbus to communicate with
> NetworkManager. From the security standpoint, such approach clearly
> loses to the simple unix socket communication restricted by natural
> POSIX permissions.

The wpa_supplicant daemon runs with dbus capability.

-- 
Brian.


Reply to: