Comments (3)
This would be nice, but be aware that it is tricky to get right. The functionality should (probably) use systemd-ask-password, since it has to work during boot and after, on all kinds of systems. Also, finding the correct interface may require a few iterations of code. Don't let this stop you proposing something, but keep in mind that it will not be a one-shot thing.
I am looking forward to your ideas!
from netctl.
Status update:
I've looked through the code and read documentation.
The current netctl code heavily relies on having config files (both wpa_supplicant.conf and netctl connections) on disk, changing that seems include more code rewriting than needed.
As far as I know wpa_supplicant does not support reading the password from another place than the configuration. So that limitation has to be worked around.
Solutions:
- change wpa_supplicant's behavior (like allow reading the password from stdin)
- storing the configuration on a tempfs (dependency on mount, tempfs and enough ram)
- sending the configuration through a unix socket
- remove config file or the password from it after the connection is established (password touches the disk)
- same as 4 but clear the password from both netctl and wpa_supplicant config files
I'd rather not mess around with unix sockets or changing wpa_supplicant. Writing the password to disk and then deleting feels a bit lazy and does not entirely meet my goal of not storing the password, at least this minimizes the time it is stored.
Using a tempfs would be the way I'd go, as it should not require many changes (mostly new code which carefully mounts a tempfs)
For Implementation I'd add a setting to the netctl config, something like "ask-pass=yes". And try branching off here with the new special case.
It will probably take some time till I find time for writing a PoC, and then a bit longer for polish, documentation and testing.
EDIT: Just after writing this I find out that wpa_cli
could probably be used to provide the password.
see: https://w1.fi/cgit/hostap/plain/wpa_supplicant/README
wpa_cli -h | grep password
So we could do: wpa_cli password <network id> $(systemd-ask-pass --id=netctl:<network name>)
after starting wpa_supplicant
from netctl.
With the current git version of netctl
(including 8c873b4), it is easy to implement asking for a password using a hook.
Simply add the following contents to /etc/netctl/hooks/ask-password
ask_password() {
[[ $Command != start ]] || systemd-ask-password "$Description requires a password:"
}
and mark the hook as executable through chmod +x /etc/netctl/hooks/ask-password
.
Now, asking for a password is possible by including the following line in a profile:
Key=$(ask_password)
If this information is useful, please add it to the netctl wiki.
from netctl.
Related Issues (20)
- [email protected] is not started after interface is inserted HOT 9
- Reduce/remove waiting time for pluggable WiFi devices on startup HOT 9
- netctl-ifplugd Unable to get ip address HOT 3
- [Feature request] Auto retry wifi connection HOT 5
- Add option for accept_ra value HOT 6
- Support stable private IPv6 addresses HOT 4
- Allow regular user to `netctl switch-to <profile>` HOT 2
- [Feature request] Blacklist access points. HOT 10
- NO SSID environment variable HOT 6
- Only one hook works at a time HOT 3
- netctl wanted by multi-user.target, slowing down boot HOT 4
- netctl-auto list_netctl_auto_interfaces() function bug HOT 1
- Add a command for WPS Push Button HOT 4
- How to configure pppoe with macvlan interface? HOT 7
- Check config file when restart command HOT 5
- When an issue occurs in the ISP, the systemd service of pppoe will fail. HOT 10
- Hook not executed for netctl-auto HOT 8
- Error while executing the script via ExecUpPost HOT 1
- No way to leave resolv.conf alone with DHCP profile (?) HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from netctl.