Device hostname modified by live environment

Hi

I have a Fedora 30 system running. The other day I created a bootable flash USB with DD to try out the live KDE environment on KDE Neon.
I just noticed that my computed name has been modified to “neon” (noticed it in terminal…!)
The only thing I have done is try to open my LUKS /Data Hard drive from the live environment, which failed because (I suppose) Neon cannot open LUKS v2 devices.

How can this have happened? how could the live environment access my encrypted root partition and change the hostname… !!! or was it bug while creating the flash drive?

Have a good day

I have some questions:

  • what is DD?
  • did the name stay “neon” after you have rebooted into the installed system again?
  • You were trying to open /Data hdd, is that location on the root disk?

Thanks

dd is a command line utility for coping blocks of data, it’s commonly used to copy disk image to a USB Flash device, or in reverse – to create a bit-perfect image of a device.

man dd

will tell more about it.

2 Likes

Your hostname might be transient, so it is affected by the previous unexpired DHCP lease.

Let’s collect the related diagnostics:

cat /etc/hostname
hostnamectl status
3 Likes

Yep, that’s the reason for my question…

@vgaetera, will check that as soon as I get home. I’m confused though, where is the hostname value stored during reboot after leaving the live environment ?

When any computer asks a DHCP server (at home DHPC is usually run by router) for an IP address, it can optionally tell the sever it’s hostname.

DHCP gives back (leases) an IP address to use (with an expiration time), and stores a record containing this IP address, mac address of a network interfaces that IP was given to – and optionally a hostname.

So when your computer asked for an IP after reboot – it got an answer with an address and hostname assigned previously to the Live session. DCHP doesn’t distinguish between OS’es, it looks at the MAC address – so it saw a request for an IP from the same MAC, looked for an IP it got assigned previously, and answered something like: ow! I already know you! Your IP is this, and by the way your hostname previously was this.

And as far as I understand it, if your system haven’t got a static hostname, it would use what it received from a DHCP server as a transient (i.e. temporary) hostname.

From man hostnamectl:

This tool distinguishes three different hostnames: the high-level “pretty” hostname which might include all kinds of special characters (e.g. “Lennart’s Laptop”), the static hostname which is used to initialize the kernel hostname at boot (e.g. “lennarts-laptop”), and the transient hostname which is a fallback value received from network configuration.

4 Likes

Ah, I see. I know dd for copying blocks of data, I thought it might be something else, when you used in capitals, such as DD.

As far as your question is concerned, I believe that @nightromantic answer explains why your hostname was set differently. If you set your hostname using hostnamectl (or you edit the configuration files), that hostname should be used whenever you start your system.

Very interesting, I learned something there ! I would never have thought that the router could change that setting ! Strange though that the hostname configured during installation (or in settings) isn’t used as a ‘static hostname’ following above definitions.

Out of curiosity, do you know of other things that could be modified by a live environment ?

Thanks for your answers !

It depends on what is considered a change.
If hostname was transient initially, it is still transient and will not become static by itself.
So, from the point of persistent configuration, nothing has changed.

The hostname is outside of the OS area of control when it is configured as transient.
More predictable behavior requires a static hostname or additional DHCP server configuration.

1 Like

Correction: the answer of why was by @vgaetera, mine was merely an explanation of the mechanics he meant.

Note, it didn’t set the setting, it’s the same as with IP address assignment – it’s not a setting in your installed system, it’s more merely an answer by router to a question asked by your system.

It is, by the thing is that we don’t configure hostname during installation anymore (we did on F28 or maybe F29 and previously, but that setting was definitely removed from installer on F30 or a bit earlier). You can still set in after installation with hostnamectl command. I do)

Nothing comes to mind, unless you modify it yourself from the live environment.

And I strongly second this, I don’t see it as a modification of any kind.

1 Like