Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

The perfect scenario for all you command line jockeys. Recently, I was removing KDM from my linux partition ( I run sabayon), and apparently got rid of a bit of Gnome that was crucial to loading a desktop environment. Even though I checked libs, confs and deps.

So my question is, how do I connect to wifi from the command line, so that I can reinstall the missing packages? Wifi is the only available internet for me right now, and I'd like to get my partition back the way it was.

As far as additional information goes, I believe I have wpa_supplicant installed, and the wifi requires a username and password in my Windows partition.

No matter what y'all come up with, I'll be impressed. Command line is awesome.

share|improve this question
    
Hi and welcome to SU. Please remember to include your Linux distribution, answers may depend on it. Also, we tend to expect questions to show a little research. Did you maybe search google for "command line connect wifi"? –  terdon Sep 20 '13 at 3:55
    
I did include my distro, and I have searched and attempted to use the gentoo reference for wireless connection via the command line, as gentoo is the parent to sabayon. –  SamuraiHelmet Sep 20 '13 at 16:26
    
So you did, my bad, I missed your mention of sabayon. Please include some of the things you tried and how they failed so we don't reinvent the wheel in giving you answers. What happens if you use wpa_supplicant as suggested by the various google answers? Also post the output of iwcongif. –  terdon Sep 20 '13 at 16:33

1 Answer 1

The info in your post is incomplete, so I'm operating under a number of assumptions:

  • your WIFI connection wasn't configured previous to you hosing your install
  • your WIFI is WPA2 secured (more on that below) you'll need to retrieve your WIFI passphrase, for that I presume you know how to boot your Windows partition and operate a pen & paper
  • your WIFI card is wlan0 and has correct modules loaded
  • Sabayon hasn't bastardized Gentoo that much

To get connected, edit /etc/wpa_supplicant.conf - check if it contains a reference to your network, if not you'll need to add it backup the file first and then add:

network={
    ssid="YOUR NETWORK'S NAME HERE"
    psk="YOUR WIFI PASSWORD HERE"
    priority=99
}

If your mention of a username wasn't a mistake, this will complicate things a little - you'll have to remove the psk= .. line from the above as your AP is probably open

Then edit /etc/conf.d/net and ensure it contains the following:

modules="wpa_supplicant"
config_wlan0="dhcp"

Then start the interface with:

/etc/init.d/net.wlan0

If that file doesn't exist, you'll need to link it first:

ln -s /etc/init.d/net.lo /etc/init.d/net.wlan0

If all has gone well, you now have internet access.

If your WIFI did require that username you mentioned, you're SOL unless by chance you have links installed or there's a massochist here that wants to guide you through the process of crafting a script that'll submit a form to log you in.

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.