Coding - Getting the names right

Created by: Lester Caine, Last modification: 7 September 2025

Until recently I had simply worked with the names that openSUSE used by default, but that has become increasingly a problem as there is no consistency in some areas. In addition while localhost works for a one machine setup, having all three machines returning it when logged in using ssh was becoming problematic, so the first step was to ensure that hostname is set up on each machine. Fairly simple to do, but of cause it breaks a lot of things! Currently I can't use sftp into the old server and can't see what is broken since the other two machines seem to be set identically and work.

The first element is simply hostnamectl which in addition to displaying the Static hostname also display other useful information. (Is the old server really 11 years old? It's still running nicely). In the past I would simply have edited the /etc/hostname file, but that missed some elements I think, so hostnamectl set-hostname newhostname is the correct approach. A reboot is flagged as optional, but I now suspect that it IS the next step before trying to sort out the knock-on effects.

The next step in the jigsaw is the SSH key, which had been set up using the machine IP addresses which I think should still work, but it is replacing those in the ssh call that was part of the objective here so using the process

ssh-keygen -t rsa -b 4096 -C "user@srv10"
ssh-copy-id user@srv10
ssh user@srv10

A new set of keys were generated for 'lester' and also 'root', remembering to switch to root on the target machine before bulding that version. This results in six new keys across the therr machines and SHOULD allow access without needing to manually type passwords each time. Some people will object to my casual use of the root account, but when using ssh into the server it avoids having to worry about sudo and more important allows access to the log files directly. I tend to have three tabs open in the console, as I have now. root into the two servers and just a plain lester into the desktop machine.