# Early access to wifi or bluetooth

## danmc

Hi everyone,

Does anyone in the community know of a way to enable either wifi or bluetooth (or both, why not) before a user logs in (in graphical mode)?

I am trying to implement a mechanism that uses a second device to send the credentials to the computer and does the authentication that way, but I need to find a way for the second device to be able to communicate with the first one.

Any, insights on the security problems are also welcome.

Thanks for your help!

----------

## szatox

That "early" access means "any time before user logs in", right? So.. that's exacly what init scripts are for. Simply configure uor networking to start automaticaly, there are at least 5 ways to do that, but what they have in common is:

1) You need a service that will configure your network

2) You add that service to default runlevel

----------

## danmc

Hi szatox,

yes the 'early access' means exactly that, anytime before the user logs in so it can actually be used to log in.

Thank you. I'm not sure how the implementation will go, but I am surprised that it can be handled so simply: init!!

Very elegant.

I wonder if systemd would offer something that simple?

----------

## Ant P.

net-misc/connman can handle both connection types (even at the same time), and runs as a system service. That would likely be easier than trying to connect the bluetooth side manually.

----------

## szatox

Well... I know several options for services making it work. Not sure if all of them provide systemd starting scripts, but they are more likely than netifrc  :Very Happy: 

dhcpcd

wicd

networkmanager

hand-written file with commands you would use to configure your network after login, stuffed into /etc/init.d

Perhaps you are already using one of those. The trick would be limited to adding them to default runlevel. I can't help you with that part though, as I'm happy openrc user

oh, btw, I have also a service for bluetooth. Provided by package net-wireless/bluez. Gnome might provide something like that as well.

----------

## danmc

@ Ant P.

Thank you for the tool suggestion. It's great to know that at least one tool can handle both. Too start with, though I think I'll concentrating on wifi as it seems a lot simpler.

@ szatox

wow!! I've only heard of openrc, but never used, tried or seen anyone who used it.

I've had some experience with the three tools you list, so at least I'm not starting everything from scratch!!

Thank you all for your suggestions.

Anyone brave to comment on the security implications?

----------

