With the new release of Ubuntu 7.04 (aka Feisty Fawn) the Network Manager has become the standard way of connecting to wireless (and wired) networks in Ubuntu.
While this new way has some drawbacks (connection is only established on login, so time doesn't get synced with the internet on startup) it is a great way for all the Linux roadwarriors to easily connect to all sorts of networks. In this mini-howto I will show you how it is done. I will also show you how to automatically connect after the login without needing to enter your gnome-keyring password.
The Screens
When logging in to your fresh install of Feisty the first thing you will notice is a new icon (the network-manager applet) that says you are not connected to any network:
Since the SSID of my network is hidden, I have to enter it manually. So I left-click the icon and chose Connect to Other Wireless Network.
Now I enter my SSID (Boognish), pick the wireless security I set up in my router (WPA-PSK TKIP) and enter my wireless encryption key.
The connection is not established right away. Since this is a fresh install of Feisty, I don't have a default gnome-keyring, yet. The Gnome Keyring is something like a password vault, which other Gnome applications can use. It can also store password for things like FTP servers or SSH sessions. If you don't have a default keyring, yet, Gnome will automatically create one and ask you to enter a master password. So next time you want to connect to a known WiFi network (or an FTP server) you will only be asked your master password. As your master password I would chose the same as your login password (more on that later).
After you hit OK, your wireless connection will be established.
The Magic
Now everytime you start your computer and log in, you will have to enter the master password for your Gnome Keyring and you will be connected to your WiFi network. For me, personally, it is a little bit annoying to enter my login password, and right after that enter it again to connect to the wireless. So what I do is, on login I hand over the login password to the gnome-keyring. That means the gnome-keyring is open on login and the network-manager can use it right away and won't ask you for a password (Note: In an environment where security is important you don't want this behavior). As it is your login password that is passed on, your gnome-keyring password has to be identical to it (as mentioned above). If you created your keyring with a different password see below.
To accomplish this we have to install a package and modify a file. Lets open the Terminal to do it (Applications -> Accessories -> Terminal).
# to install libpam-keyring enter
user@host:~$ sudo apt-get install libpam-keyring
# and to modify the gdm login file do
user@host:~$ sudo gedit /etc/pam.d/gdm
Now the texteditor gedit will open with a file. To the end of the file append the following three lines:
# use session pw for gnome-keyring
auth optional pam_keyring.so try_first_pass
session optional pam_keyring.so
Now save it and close gedit. That is it. You will never be asked the keyring password again.
The Troubleshooting
- If your Network Manager doesn't show anything, chances are good your WiFi interface is not managed by it. In System -> Administration -> Network you have to enable the Roaming Mode for you wireless interface to allow it to be managed by the Network Manager. Reboot. If it still doesn't work open and modify the file /etc/network/interfaces (with sudo gedit like above) and comment-out all lines except two, so that it looks kind-of like this:
auto lo
iface lo inet loopback
#auto eth0
#iface eth0 inet dhcp
#auto ath0
#iface ath0 inet dhcp
If it still doesn't work your wireless interface is probably not supported out-of-the-box and you will have to install the drivers yourself.
- If you created your gnome-keyring with a password different from your login password you cannot change it (the idiots forgot to implement this feature). You will have to delete it alltogether.
rm $HOME/.gnome2/keyrings/default.keyring
- If you want to remove the password stored for a network you can go to System -> Administration -> Keyring Manager
- BTW: The network-manager saves its profiles here: $HOME/.gconf/system/networking
The Bottom Line
On my stationary desktops I deactivated the Network Manager in favour of the traditional ifup/ifdown mechanism because I want my network to be up at boot-time. But for laptops this is really a nice thing and in the future I think we can expect the Network Manager to work seamlessly with ifup/ifdown. So lets see what the next Ubuntu release will bring.
Cheers,
Matthias
I have just installed feisty fawn and I have not the choice wpa for the wireless security, only wep, though wpasupplicant is installed.
Hi jius,
do you know the manufacturer of your WiFi interface? That kind of information would really help to figure out what the problem is.
You can find out which card was detected by ubuntu by entering in the terminal lspci or lsusb or lspcmcia, depending on where you WiFi interface is located. If you have a notebook with integrated wireless it will most probably be a PCI interface i.e..
In some cases the wrong driver is used and you have to blacklist it to be able to use another driver.
I would surely appreciate knowing what model network adapter you so successfully connected to the Internet is. I have been frustrated for weeks an cannot connect wirelessly. Your blog is helpful but won't work for my card. Thanks!! Jim
hi jim,
more information would be nice ;) I can tell you from my experience that there hasn't been a WiFi device I couldn't get to work with WPA, except some USB-Sticks..
If you'd speak German I would gladly point you to the Wiki of the German community since it is much more organized than the English documentation. But your name being Jim I figure you rather want some English documentation, so here it is:
https://help.ubuntu.com/community/WifiDocs
Some steps to take:
1. in the terminal write iwconfig and see if it lists interfaces with "wireless extemsions", if so everything "should" be fine..
2. if no interfaces with wireless extensions are shown, install the windows drivers using ndiswrapper
3. if interfaces were shown, but it doesn't work, find out which driver was loaded, blacklist it and install windowsdrivers with ndiswrapper..
I can't give you much more support here.. if I did I could just as well write up the whole English WiFi documentation (I did write alot of the German docs) and I'm not willing to do that ;)
Hi,
I have one with Atheros chipset and it worked, thanks to this post, I thought like you, to use this wep thing through the System -> Administration -> Network, where you can see only WEP. This is the wrong way, there just activate the Roaming thing on the top. And like magic, your Network Manager, that icon on the upper tray, will show you that you can connect via wireless.
You see sometimes the things are a bit simpler than we thought!!!
Cheers lad,
Hi dakura
Thanks for your interest.
The manufacturer of my dongle wifi is sagem.
lsusb displays :
Bus 003 Device 003: ID Ocde:0008 Z-Com
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
I have also the error : the network needs security fonctions which are not supported by your hardware.
The driver in use may support only wep. Unfortunately, the links to find drivers seems dead on ndiswrapper website.
Okay, your problem is probably the following: your NIC is recognized as another brand, so the wrong driver is loaded. What you do is this: figure out which driver is loaded (lsmod) and blacklist it (kernel module blacklisting). Now you install ndiswrapper und use it to run the regular windows drivers.
For detailed steps please check out the Ubuntu wiki and the forums. I hope I pointed you in the right direction ;)
THANK YOU!
Hi, I had originally made my keyring my wpa password and not my login password. So I deleted the keyring, rebooted, and remade the keyring password to match.
then i followed your instructions and appended those three lines to the file. Im still having to enter in my keyring everytime i boot. i do have autologin set so i dont have to login when my pc boots, fyi.
why is it still making me enter the keyring pw?
Hey! I completely forgot about this. If you use autologin you will have to edit a different file. It is also in /etc/pam.d and is called something like gdm_autologin. I'm not sure because I'm not at home right now (and have no Linux-box close-by). To that file you'll have to append the same three lines.
<b>NOTE: This will make your computer VERY insecure!</b> Having autologin is secure already, but using both, autologin and automatic opening of the keyring will leave everything protected by the keyring completely unprotected. So I would strongly advise against this!
Great guide! I just have one minor nitpick. The proper way to use libpam-keyring is to add "@include common-pamkeyring" to the end of your gdm login script instead of the auth and session lines. This should be more future-proof.
Terrific!! Thank you for posting this.
I would like to know how you got this to work without Network manager, I am using a desktop to I don't need to connect to different wireless networks, can you tell us how you did that?
I don't understand your question?! This article is ABOUT Network Manager (because it is the new default in 7.04). Wired connections work out-of-the-box, so do wireless connections. If you don't use wireless, just plug in a cable, c'est tout.
Hi Dakira,
That really worked well. Thanks for this useful post.
--
sur
http://expressica.com
can someone point me to a howto for matthias' definitive decision:
"I deactivated the Network Manager in favour of the traditional ifup/ifdown..."
hey moore,
here's a quick-howto:
1 encode your wpa passphrase
user@domain:~$ wpa_passphrase MySSID
* reading passphrase from stdin
thisisatest
network={
ssid="MySSID"
#psk="thisisatest"
psk=f06fd0e47d93637c3654[...]
}
2 create /etc/wpa_supplicant/wpa_supplicant.conf with this content:
ctrlinterface=/var/run/wpasupplicant
eapolversion=1
apscan=2
network={
ssid="MySSID"
scanssid=1
proto=WPA
keymgmt=WPA-PSK
pairwise=TKIP
group=TKIP
psk=f06fd0e47d93637c3654[...]
}
3 use it by editing /etc/network/interfaces
and make the section with your wireless interface look like this:
-- snip --
auto ath0
iface ath0 inet dhcp
wpa-conf /etc/wpasupplicant/wpasupplicant.conf
-- snip --
assuming your wireless nic is called ath0.
4 in session management prevent the networkmanager and the gnome applet from being started.
I wrote a comprehensive WiFi documentation in the German Ubunuusers-Wiki for those who are interested. It's too bad that the official wiki is so underdeveloped, I couldn't find a good link that describes all the details ;( There are some options to the above e.g., that might solve problems. wpa-driver allows you to specify a driver if the default generic driver (wext) doesn't work (for me wext worked with ipw, atheros and ndiswrapper).
Well, I hope this answers your question ;)
Great guide, but this does not work for mine. (7.04)
I have two wifi cards: Atheros and ipw2200. Both are recognised and a iwlist ath0|eth1 scanning reveils APs with TKIP etc. However, the drop down list on the Gui only lists WEP. WpaSuppliment is installed along with madwifitools.
These cards can connect with WPA/TKIP in Windows.
What gives?
The cards you have have the best support available for linux, so the problem should be elsewhere..
Anyway.. try upgrading to 7.10.. maybe that solves your problem.. Also post your problem in the Ubuntu Forums at ubuntuforums.org