To change the hostname of an OpenSUSE Linux system, follow these steps:
-
Edit the hostname file:
sudo nano /etc/hostname
-
Replace the existing hostname with the desired one and save the file.
-
Update the
/etc/hosts
file to reflect the new hostname:sudo nano /etc/hosts
-
Change the hostname in the line starting with
127.0.0.1
to the new hostname. -
Save the changes to the file and exit the editor.
-
Restart the network service to apply the changes:
sudo systemctl restart network.service
-
Verify that the hostname has been updated by using the following command:
hostname
After these steps, your OpenSUSE Linux system should have the new hostname you specified.