Kicksecure /etc/hostname /etc/hosts

whenever you type sudo something it says:

sudo: unable to resolve host localhost.localdomain: Name or service not known

1 Like

Confirmed bug. Workaround:

sudo hostname localhost
1 Like

Apparently there is no real default hostname. By Debian default, /etc/hostname and /etc/hosts is not managed by any package. For Debian installations that file is generated by Debian installer.

I thought by writing localhost into /etc/hostname during Kicksecure build process could be avoided to have /etc/hostname or /etc/hosts managed by any package in Kicksecure. And then later user can just customize it if needed. But that does not workā€¦

Even though /etc/hosts by default (as created by grml-debootstrap)ā€¦

Already contains:

127.0.0.1       localhost 

Other VM creation tools (example: grml-debootstrap(8)) set /etc/hostname to something (example: grml).

I wonder where Debian is getting the .localdomain part from anyhow? It is nowhere to be found in folder /etc.

https://lists.debian.org/debian-devel/2005/10/msg00387.html

Related:

solved (message gone) by:

go to /etc/hosts

change:

127.0.0.1 localhost

to

127.0.0.1 localhost.localdomain localhost

[Ref]

1 Like

I donā€™t want to add this by default. Not sure you suggested that but in case if anyone interprets it as such as suggestion, hereā€™s why.

This long thread and who knows where it even started looks rather complicated:

https://lists.debian.org/debian-devel/2005/10/threads.html#00194

Might argue somewhere against .localdomain such as here:

https://lists.debian.org/debian-devel/2005/10/msg00387.html

Since some modification must be shipped anyhow, and since there is no generic default / convention for default host name, can as well as also add a ā€œproperā€ hostname, i.e. not localhost.

Will probably use same settings in Kicksecure as in Whonix. I.e. default hostname host.

I.e. package kicksecure-base-files effectively shipping files:

  • /etc/hostname
  • /etc/hosts

Unless there are better suggestions for default hostname / hosts file / implementation details.

1 Like

Now I remember why I didnā€™t want to add files /etc/hostname and /etc/hosts into packages. This is because for Kicksecure weā€™ll be needing to rely distro morphing installation method for the server use case for a while. Users using VPS will probably have no other chance than telling their VPS provider to install Debian and then sudo apt install kicksecure-cli. In that case, the installed packages shouldnā€™t modify the serverā€™s existing /etc/hostname and /etc/hosts. Therefore for Kicksecure builds, these files need to be auto generated during the build process so that these arenā€™t managed by any packages.

1 Like

But many of the VPS now providing freedom of uploading your own distro
ISO, So not really every host provider this applies to it.

Patrick via Whonix Forum:

1 Like

I see. I didnā€™t notice or overlooked that. Good to know.

1 Like

Inside a Kicksecure VMā€¦

cat /etc/hostname

localhost

Looks correct.

cat /etc/hosts

127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Looks also correct.

dsudo test

No output as expected (no error message), also ok.

hostname

localhost.localdomain

This is wrong.

Why is that? Related to network manager, DHCP?

Related to network managerā€¦

Quote NetworkManager.conf(5) ā€” network-manager ā€” Debian bookworm ā€” Debian Manpages

hostname-mode

Set the management mode of the hostname. This parameter will affect only the transient hostname. If a valid static hostname is set, NetworkManager will skip the update of the hostname despite the value of this option. An hostname empty or equal to ā€˜localhostā€™, ā€˜localhost6ā€™, ā€˜localhost.localdomainā€™ or ā€˜localhost6.localdomainā€™ is considered invalid.

Bingo.

This will be fixed after updates.

(The following file will solve it.)