You are not logged in.

#1 2022-05-18 07:34:55

Ferdinand
Member
From: Norway
Registered: 2020-01-02
Posts: 331

No networking before login?

I'm using Network Manager exclusively for my networking; internal DHCP client, and configuring it with nm-connection-editor.

I'm in the mood to disable all networking until I log in. Primarily for security purposes, but also because I simply don't need any networking when I'm not logged in, so everything can just sit on it until I'm good and ready smile

The problem is I got a bit confused trying to figure it out, and would like to appeal for some insight.

I want to connect automatically when I log in, so I want my nm-connection-editor settings to hold (i.e. I want the settings in /etc/NetworkManager/system-connections to be as I have defined them).
I see two ways about it:

  1. Changing Network Manager configuration

  2. Changing systemd configuration

With respect to the first, I tried adding

[main]
no-auto-default=*

to /etc/NetworkManager/NetworkManager.conf (it's the only content in the file), but that turned out to be futile of course, as the automatic connections, defined in /etc/NetworkManager/system-connections, kicks in, and connects the interfaces I have defined.

Now, that other avenue would be to delay networking until after I logged in - but to my understanding I can only hold a systemd service until a specific target, and there is no target for "the first interactive login" - so am I'm basically looking at disabling the system service and creating a user service for starting Netwok Manager? That would have to be per user, as, in principle, I can't know which user logs in first. And I'm not sure what that would mean for other services waiting for networking - will networking started with a user service fulfil "network.target"?

I could just try of course, but I figured this maybe is interesting for others too, and is complicated enough to warrant a request for insight, rather than just resorting to semi-ignorant hit-and-miss'ing?

Offline

#2 2022-05-18 09:35:44

dogknowsnx
Member
Registered: 2021-04-12
Posts: 648

Re: No networking before login?

This could be achieved by setting up e.g. gnome-keyring


RI - Rest your Eyes and Self

"We are eternal, all this pain is an illusion" - Maynard James Keenan

Offline

#3 2022-05-18 16:12:21

Ferdinand
Member
From: Norway
Registered: 2020-01-02
Posts: 331

Re: No networking before login?

Thank you for replying, @dogknowsnx!

I'm afraid I need a little spoonfeeding on that one... for example, how would I configure, or use, gnome-keyring to prevent my computer from connecting to a wired network until after I log in?

Oh,  but you woke my brain cell - with reference to my list above, there should be a third way - to disable all network interfaces on boot, and then enable what I need on login?

Offline

#4 2022-05-18 17:26:40

tucuxi
Member
From: Switzerland
Registered: 2020-03-08
Posts: 291

Re: No networking before login?

I probably have not understood all nuances of your endeavor. Starting NetworkManager as a user instead of a system service seems too obvious.

Offline

#5 2022-05-18 19:48:27

dogknowsnx
Member
Registered: 2021-04-12
Posts: 648

Re: No networking before login?

Since you mentioned security, encrypting the network password came to mind, where it wouldn't be stored by NM in clear text, thus requiring NM (or any other app - for that matter)  to "go through the keyring" on login. Here's another spoonful... smile

EDIT: You will still have to find out yourself whether/how this applies to wired networks, though...

Last edited by dogknowsnx (2022-05-18 20:01:54)


RI - Rest your Eyes and Self

"We are eternal, all this pain is an illusion" - Maynard James Keenan

Offline

#6 2022-05-18 21:00:58

seth
Member
Registered: 2012-09-03
Posts: 51,056

Re: No networking before login?

Is this a wired connection?
=> Explicitly configure the connection profile for the nic, set autoconnection to false and then up it w/ your session.
https://access.redhat.com/documentation … networking

Offline

Board footer

Powered by FluxBB