Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I connect to a WPA2 Encrypted Network from the Terminal/Console?

I've wanted to remove the whole x-window system and use a Terminal based system only to free up any available memory and process list(s), but the only way to I have to connect to my ESSID network right now is via the Network Manager.

One other thing of note is that the wpa-supplicant is currently not working for my Zydas USB card.

share|improve this question
up vote 4 down vote accepted

You can use cli to networkmanager called cnetworkmanager or wicd which also has command line utility and gtk is just optional. I think wicd uses wpa_supplicant.

share|improve this answer

This works, if you can keep X around, but just don't want to use it, and want your system to connect to wireless without starting X.

Start X and use nm-applet to conncet to your wireless. Then bring up context menu of nm-applet and choose Edit connections. Choose Wirelless tab, select your connection and Edit. Now mark the Available to all users checkbox. Authorize this action with your password and Save.

Now after reboot your system should automatically connect to the wireless without logging into X.

share|improve this answer
Can I remove X without losing auto connecting during boot time? – Adrian K. Jul 17 '11 at 12:26
Sure, You are free to remove X, of course while you don't need to add a new wireless connection :) – Reinis Jul 18 '11 at 11:18
And after I wrote this answer I remembered wicd as @sagarchalise mentions in his answer. wicd has nice curses interface - install package "wicd-curses". However in my experience wicd is slower to connect than network-manager. Furthermore You cannot run wicd and network-manager simultaneously, if I remember correctly. – Reinis Jul 18 '11 at 11:32

You could install a lightweight window manager like LXDE. if you want to connect to a wifi network without graphical environment you should learn about the iwconfig and iwlist and then use the iw wlan0 connect command to connect to your wifi network.

share|improve this answer

Your Answer


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.