hostname unchangeable / some daemon changes and resets /etc/hostname
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
subiquity |
Fix Released
|
Critical
|
Michael Hudson-Doyle | ||
cloud-init (Ubuntu) |
Invalid
|
High
|
Unassigned |
Bug Description
Hi,
I just ran into a strange problem with renaming a machine:
I've configured a new machine (HP Microserver with 18.04 server edition) in order to replace an older one, and thus gave it a temporary hostname serverx.
After finishing all configurations and removing the old machine named server, I tried to rename the new servers hostname from serverx to server.
I've tried that six times by either manually editing /etc/hostname or using hostnamectl to set the new hostname 'server', and the file /etc/hostname has provably been changed to 'server', but after rebooting the machine always comes up with the old hostname 'serverx', and even the /etc/hostname file is reset to 'serverx', which a fresh file mod date.
I'm not sure what does that reset of the hostname and modifies /etc/hostname, but since systemd is almost always the source for all sorts of trouble, I guess it is a combination of the DHCP reply and systemd.
I currently see no clean and regular way to change the hostname of this machine. Whatever I do, it comes up with it's old hostname. I don't even see what software component is changing the /etc/hostname,
That's a no-go and a security breach. No daemon or other software must ever change /etc/hostname without admin's consent.
If this is caused by cached DHCP responses, a fake (or faster) bogus DHCP server could push wrong hostnames into hosts.
Anyway, it is a severe security problem if a machine changes it's hostname in a way the admin doesn't want. That could cause lots of misconfigurations (e.g. when configuring machines with tools like puppet or ansible, get wrong IP addresses from DHCP, wrong firewall rules and so on). It can cause severe denial of service problems and allow such attacks.
What the hell is changing /etc/hostname during boot?
Why is editing /etc/hostname oder using hostnamectl not effective and violating it's own man pages?
information type: | Private Security → Public Security |
tags: | added: bionic |
Changed in cloud-init (Ubuntu): | |
importance: | Undecided → High |
tags: | added: rls-cc-incoming |
Changed in cloud-init (Ubuntu): | |
status: | New → Invalid |
Changed in subiquity: | |
status: | New → Triaged |
importance: | Undecided → High |
tags: | added: id-5c7005ca28674083fa893f95 |
Changed in subiquity: | |
importance: | High → Critical |
assignee: | nobody → Michael Hudson-Doyle (mwhudson) |
Changed in subiquity: | |
status: | Triaged → Fix Committed |
Changed in subiquity: | |
status: | Fix Committed → Fix Released |
Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https:/ /wiki.ubuntu. com/Bugs/ FindRightPackag e. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.
To change the source package that this bug is filed about visit https:/ /bugs.launchpad .net/ubuntu/ +bug/1780867/ +editstatus and add the package name in the text box next to the word Package.
[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]