Page 2 of 2

Re: user.and root différente hostname, is it normal?

Posted: 29. Jun 2022, 17:59
by gapan
SalixManiac wrote: 29. Jun 2022, 17:49 but always,

$sudo dmesg
(root@darkstar)
That is reported right when it boots, before anything gets read from the drive, so it uses the hostname baked into the kernel.
SalixManiac wrote: 29. Jun 2022, 17:49 $sudo find /etc/ssh/ -type f -exec grep -H 'darkstar' {} \;
/etc/ssh/ssh_host_ed25519_key.pub:ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO+CvUDEpzBjqOrAzOywjEbRuTgNbQwfhWENSpwuWkLd root@darkstar
This was created before you changed the hostname. You may recreate your ssh keys if you want that changed, or you can just edit it with a text editor to your desired hostname or anything else really, it doesn't really matter.

Re: user.and root différente hostname, is it normal?

Posted: 29. Jun 2022, 18:11
by SalixManiac
That is reported right when it boots, before anything gets read from the drive, so it uses the hostname baked into the kernel.
i have a kernel based on the slackware source kernel but without: CONFIG_DEFAULT_HOSTNAME="darkstar"
only
CONFIG_DEFAULT_HOSTNAME=""

two hostnames on one machine is dangerous?

Re: user.and root différente hostname, is it normal?

Posted: 29. Jun 2022, 18:33
by gapan
But you don't have two hostnames!

I don't know about your custom kernel, you may not be using that, or you may not have configured it how you think you configured it, but your system reports the same hostname either with sudo or not.

Re: user.and root différente hostname, is it normal?

Posted: 29. Jun 2022, 19:39
by SalixManiac
Yep the same,

I think you put me on the right track, I will investigate the kernel, but all salix users who use the Kernel Slackware must have the same problem.

No need to touch the SSH key it is a symbolic link
7zigvkkrgrgrnwv8h8aicbv8fuwk79iq = root@localhost

I would keep you informing of my adventures :geek: .

Re: user.and root différente hostname, is it normal?

Posted: 30. Jun 2022, 14:32
by SalixManiac
SOLVED

All I know is that I don't know anything.
It is certainly a Userless method

I recompile the kernel with:
CONFIG_DEFAULT_HOSTNAME="coquelicot"
Image

now the root hostname match with user hostname:
Image

I have changed darkstar by my hosname in:
/etc/ssh/ssh_host_ed25519_key.pub
Here it is not a symbolic link.

It may be a bad idea to change the user hostname without changing the Root Hostname.
I think it's not a bad idea to change Darkstar like Hostname for Root and User.

thank you for your help gapan