2

How do we manage wireless connections without a network manager?

This excellent answer walked me through connecting to the protected wireless network at home. In short,

nano /etc/network/interfaces  # enable dhcp
service networking start
nano /etc/wpa_supplicant.conf  # indicate ssid and password
ifdown wlan0  # name determined by 'ip a show'
ip a flush wlan0
ifup wlan0
wpa_supplicant -Dnl80211 -c /root/wpa_supplicant.conf -iwlan0 -B
dhclient wlan0

Another answer suggests adding this to /etc/network/interfaces:

auto wlan0
iface wlan0 inet static
address ASSIGNED_IP
netmask 255.255.255.0
gateway THE_GATEWAY
wireless-essid YOURSSID
wireless-key WIRELESSKEY_HERE

Because over time I will be encountering different networks, with different ssdi and password, I was wondering which would be the best way to approach this, without a network manager. Priorities:

  • Don't disclose ssid and passwords if my laptop is compromised - those are sensitive information that people have entrusted me with.
  • Don't clutter /etc with a ton of custom(user-created) files.
  • Don't use high-level utilities, like network-manager or wicd.
GAD3R
  • 63,407
  • 31
  • 131
  • 192
Vorac
  • 2,957
  • 8
  • 36
  • 53
  • 1
    Read up on roaming mode in the `wpa_supplicant` documentation. That's how I do it on my laptop. The goals "don't store SSID/passwords locally" and "use wpa_supplicant only" are mutually exclusive, though. If you don't want to store SSID/passwords locally, where do you want to store them? Is encrypting the harddisk of your laptop sufficient to allow local storage? – dirkt Apr 29 '17 at 11:05

1 Answers1

1

To accomplish the conditions:

Don't disclose ssid and passwords if my laptop is compromised - those are sensitive information that people have entrusted me with.

Don't clutter /etc with a ton of custom(user-created) files.

Don't use high-level utilities, like network-manager or wicd.

You should run wpa_supplicant as follows:

wpa_supplicant -B -Dnl80211 -iwlan0 -c<(wpa_passphrase "Your-SSID" Your-Passwd)
dhclient wlan0

You don't need to create a wpa_supplicant.conf .

You don't need to store your SSID and Password under /etc/network/interfaces

You don't need Network-manager , wicd ...

to correctly connect through wpa_supplicant (If you have the NetworkManager installed) , you should stop the NetworkManager.service before runing the wpa_supplicant command:

systemctl stop NetworkManager.service
systemctl disable NetworkManager.service
GAD3R
  • 63,407
  • 31
  • 131
  • 192
  • One should point out that under this setup, the user needs to enter SID and password *every single time*, for *all* APs. Also, the command will be visible in bash history etc. – dirkt Apr 30 '17 at 05:10
  • @dirkt Yes , the weakness of the network command `wpa_passphrase` is displaying the password on the terminal. – GAD3R Apr 30 '17 at 10:08