Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm starting to use the wmii windows manager and I want certain pieces of information to display on a status bar. If I were to want to display the ESSID for the network, I would have to find it through some shell command. I already know I can find the ESSID by issuing the command

iwconfig wlan0 | grep -o "ESSID:\"[a-zA-Z]*\""

but that requires you to be a super user?

So my questions are:

  1. how can I find the ESSID without any superuser privileges?

  2. is there some terminal command which gives me some gui for selecting the wireless connections? Or do I always have to do something like

    iwconfig wlan0 essid X key Y

?

I'm looking for some simple interface like the one that exists on gnome.

edit: i messed up the regex

share|improve this question

1 Answer 1

up vote 3 down vote accepted

I think that the permissions required to get the wireless information depends on the driver. When I was using the wl driver non-root users could not get information using iwconfig, but I'm now using the b43 driver and non-root users can. I don't know of anywhere else where the ESSID is available. Your options are to either use sudo to give non-root users permission to run iwconfig wlan0 without a password, or setup a crontab which regularly saves the output of iwconfig wlan0 to a file which users can access.

If you want to use a GUI to manage the wireless interface you'll pretty much have to run NetworkManager and use one of the GUI clients, like the GNOME system tray applet.

If you want to manage the wireless interface from the CLI you have two options. You can either run NetworkManager and use the CLI client, cnetworkmanager, or you can run wpa_supplicant from /etc/network/interfaces. To do that, add the following to /etc/network/interfaces:

auto wlan0
iface wlan0 inet dhcp
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

Then configure your networks in wpa_supplicant.conf, which will look something like this:

network={
    ssid=mynetwork
    key_mgmt=WPA-PSK
    psk="mypassword"
}

You can also configure networks with WEP keys, but you really shouldn't be using WEP. If you need to select between multiple networks available in the same location, you can use wpa_cli (although you sometimes have to manually trigger dhclient to do DHCP).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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