How to start wireless system wide before a user logs in
UbuntuThis forum is for the discussion of Ubuntu Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to start wireless system wide before a user logs in
I would like to configure the wireless networking under Ubuntu 9.04 to be automatically started when the computer reboots, before a user logs in on the console GUI. It would be preferred that the wireless network to be logged in to be fixed in that configuration so that it always tries the same network regardless of what network the last logged in user used. It would also be preferred that when a user logs in, their network choice is connected (disconnecting the previous network if different), AND reverting back to the system preference when they log out.
As mentioned in another thread, I'd like to be able to log in on the text mode console only to not have media automounting in effect (other solutions to that should be posted in that thread) but I do want to have wireless operating in this situation. One purpose (of many) for this is to transfer media device raw sector images over wireless (by some protocol such as SSH).
I would also like to do this to leave my netbook powered on when I am away, and be able to log in to it from remote. For the curious, how I would do that is an automatically initiated SSH session would be made to a dummy login on offsite server, with port forwarding from the server back to the SSH port on the netbook, so it would be SSH inside SSH.
So anyway, the ultimate issue is how to get wireless networking to be automatically started in much the same ways as wired ethernet networking can be started, but without using the ethernet port.
As far as disconnecting and connecting to a network I can't think of a real easy way to do this, but I suppose you could look into wpa_supplicant and have ascript run for the users that brings down the if than changes the wpa_supplicant.conf file changing the values of network s so that their network has highest priority then bringing the if back up. And doinf the reverse when they log out.
As far as disconnecting and connecting to a network I can't think of a real easy way to do this, but I suppose you could look into wpa_supplicant and have ascript run for the users that brings down the if than changes the wpa_supplicant.conf file changing the values of network s so that their network has highest priority then bringing the if back up. And doinf the reverse when they log out.
Ideally, the developers of the wireless and/or network management tools should just realize this is one of the desired modes of operation, and integrate it into their project. One way to do that is to have a background daemon run all the time. The user tool communicates with it internally. When that communication starts, the user is authenticated for rights to change wireless settings (user rights vs. network administrator rights). The tool communicates the user's temporary preference to the daemon and receives status. If the connection breaks, the wireless will revert to the permanent/system setting after a certain time frame (the time frame is configured by network administrator and about 30 seconds seems a reasonable starting default). Anyway, this is something that really should be part of the presented tool. I'm not the only one that wants it.
I would like to configure the wireless networking under Ubuntu 9.04 to be automatically started when the computer reboots, before a user logs in on the console GUI. It would be preferred that the wireless network to be logged in to be fixed in that configuration so that it always tries the same network regardless of what network the last logged in user used. It would also be preferred that when a user logs in, their network choice is connected (disconnecting the previous network if different), AND reverting back to the system preference when they log out.
[...SNIP...]
So anyway, the ultimate issue is how to get wireless networking to be automatically started in much the same ways as wired ethernet networking can be started, but without using the ethernet port.
Unless I have misunderstood your OP that's what happens if you apply the changes as in my post #2
Did you try it?
If so, why no feedback?
Quote:
Ideally, the developers of the wireless and/or network management tools should just realize this is one of the desired modes of operation, and integrate it into their project.
Ideally everything would work for all users, however different their needs, and under all circumstances. But different users have very different requirements. One of the advantages of linux is that you can configure it to do exactly what you want. The tools are all there. But you need to learn to use them.
Quote:
Anyway, this is something that really should be part of the presented tool. I'm not the only one that wants it.
What "presented tool", exactly? As usual, there are many varieties that you could be using. Maybe one suits your requirements better than another ( Eg "Network Manager" versus "wicd" )
Well the Daemon end of things is sort of all ready in place. I never really used network manager, I prefer editing the config files, but really you have your networking daemon that works with your interfaces and then for wireless, like in the case of wpa_supplicant you have your wpa_supplicant Daemon running. In the case of Debian wpa_suppliucant is integrated with the network daemon, in such a way that the ifup script for the wireless interface calls the supplicant config file and wpa_supplicant daemon starts at boot time. So running ifdown wlan0 will kill the supplicant daemon, and ifup will restart it, the the config file holds network information in form of essid with network encrytion and keys, this will allow aoutomatic connection to any network listed, and you can also add a wildcard that will basically connect to the closest non-encrypted strongest wireless network.
I have an idea you could ponder though.
You can override the priority setting for networks with the wpa_supplicant front end (GUI or CLI) Why not write a script that runs and changes their wireless network on logon using the wpa_supplicant front end then hav a cleanup script or something if you will that reconnects to the system network on logout, or maybe when the logon screen comes backup.
As far as starting before a user logs on, I know in Debian it does as I explained above, Debian brings the interface up on boot time and then the ifup script starts the wpa_supplicant daemon and the connects to the highest priority network listed in the conf file.
PS I have not used wicd, however it looks like a GUI front end for wpa_supplicant, although if you don't need/want to manage wired connections with it too you could use the wpa_supplicant GUI, I think it is called wpa_gui, for a front end, this would allow a user to change their network that wpa_supplicant is connected to manually based on a list or they can add one that is scanned. For greater control, you might want to just write scripts that are executed by them or on login that connect to their approriate network, and have no GUI interface at all then they can't muck up setting or do something they shouldn't.
You might also see about how you can start wpa_supplicant on boot/startup with whatever distro you are using.
Unless I have misunderstood your OP that's what happens if you apply the changes as in my post #2
Did you try it?
If so, why no feedback?
I haven't gotten to try it, yet, because of other things. I want to focus on the GUI administrative methods, rather than editing config files. I've done things the editing way in the past. Part of why I am using Ubuntu is to experience it the way people who strictly use GUI (and those that claim GUI can do everything) do it.
And I've been delayed due to other issues.
Quote:
Originally Posted by tredegar
Ideally everything would work for all users, however different their needs, and under all circumstances. But different users have very different requirements. One of the advantages of linux is that you can configure it to do exactly what you want. The tools are all there. But you need to learn to use them.
Right. And with a more raw system, I would. BTDT a lot. But if I do things that way, why have Ubuntu at all?
Quote:
Originally Posted by tredegar
What "presented tool", exactly? As usual, there are many varieties that you could be using. Maybe one suits your requirements better than another ( Eg "Network Manager" versus "wicd" )
Whatever I can find in the menu of tools. Maybe replacing NM with WICD is the answer. A couple people on IRC suggested it and will try it later. They didn't know if it could, but merely suspected it could. We'll eventually see.
If you want to use a GUI, use a GUI.
But use wicd, and uninstall NM.
Open wicd
Click the little triangle next to your AP's name.
Click "Automatically connect to this network"
Click "Advanced settings" and fill in the boxes.
You are done.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.