-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFE] Option to use SystemdCreds to read user+password #459
Comments
This all sounds reasonable at first glance. What functions would pppd need to call to read the user and password values? |
@paulusmack Note
If you use the names i used in my examples those files would be:
But as said you're free to choose other names, or even let the user choose which names to use 😉 It basically boils down to automatically read the contents of those files and use them "as-if" the user provided those options with their values....
|
@paulusmack a followup from your side would be appreciated 😉 |
@paulusmack: Have you seen latest @TriMoon comments? |
Definitely not a 2.5.1 feature. I think it would be awesome to provide tighter integration with systemd in a few different ways, e.g. networking, dns and credentials. Won't have the time to look into this anytime soon. |
There is already the +ua option, but it takes both username and password from the same file. If it really is necessary to have the username and password in separate files, it would be possible to add an option that provides a prefix to which "username" and "password" are appended to get the names of two files, from which to read the username and password. You could then do something like |
To enhance the
systemd
integration (see #79 and systemd/systemd#481) even more, i suggest to add an option to allow automatic reading of System and Service Credentials orSystemdCreds
as i like to name them.sd_creds
for example, the exact naming is up to you.When this option is used,
pppd
should automatically read and use:user
from the SystemdCreds, fe. from thePPPoE-username
credential. (the exact naming is up to you)password
from the SystemdCreds, fe. from thePPPoE-password
credential. (the exact naming is up to you)To illustrate the usage and workaround until this functionality is implemented
I'm currently using the below self-made scripts and configs in my System, which i post here for others to use till then:
(Still a W.I.P. but it already works flawlessly)
Click the arrowed sections to expand and view (and be able to copy them)...
[email protected]
[email protected]/DefaultInstance.conf
[email protected]/KernelCommandLine.conf
[email protected]/TurkNet.conf
[email protected]
[email protected]/KernelCommandLine.conf
[email protected]/Credentials.conf
[email protected]/UseCredentials.conf
<bin path>/createSystemdCreds-PPPoE
The last three are the
SystemdCreds
specific parts obviously 😉[email protected]/Credentials.conf
dir+file was auto-generated using thecreateSystemdCreds-PPPoE
script...[email protected]/UseCredentials.conf
drop-in overrides theExecStart
of the main template to read a config file that is auto-generated to implement the automatic reading and usage of theSystemdCreds
.As you can see the is FAR from optimal because it uses a temporary file which can be eliminated if the functionality asked-for is implemented.
(It is still relatively safe to use, because of the private tmp used in the hardening this file is only readable by ROOT...)
Note
I use the below parts for tearing down DynNS config.
If you don't make/need use of that functionality; you can safely disregard these parts, and you have no need to install the
/etc/ppp/ip-pre-down
and/etc/ppp/ipv6-pre-down
scripts with accompanying directories they use...[email protected]/DynNS-TearDown.conf
/etc/ppp/ip-pre-down
/etc/ppp/ipv6-pre-down
Note
To @ppp-project members:
You might consider adding this
pre-down
functionality topppd
itself, so they get automatically called BEFORE the connection gets teared down, if wanted by the user. 🤝And i use these
systemd-networked
files for the connection configs:(My onboard Ethernet connection is renamed to
utp
)21-pppoe-vlan35.netdev
21-pppoe-vlan35.network
30-pppoe-TurkNet.network
Note
This config does NOT make use of the DNS/NTP/etc setting provided by the DHCP-Server from the ISP, if you need to make use of those you can tweak the systemd-networkd config options inside.
I use my own settings on my system, that's why i disabled usage of those.
Update:
For easier testing etc of the posted files, i have created a public repo where they can be found.
It will also function as a backup for my own setup 😉
https://gitlab.com/trimoon-inc/system/systemd-PPPoE
The text was updated successfully, but these errors were encountered: