openSUSE
and SLES
will assign random hostname
to the system if not configured. It starts with linux-
followed by 4 randomised characters.
You can change the hostname
for your SUSE
system by using hostnamectl
program at the terminal.
Terminal
application. hostname
. [email protected]:~> hostname linux-ui1m
hostname
is normally displayed in at the shell prompt via \h
in the $PS1
environment variable.
hostname
using hostnamectl
. [email protected]:~> sudo hostnamectl set-hostname host [sudo] password for root:
hostname
again to confirm. [email protected]:~> hostname host
The shell prompt is not immediately updated as $PS1
is only set when a new shell is started
[email protected]:~> bash [email protected]:~>
Guide compatibility:
Operating System |
---|
openSUSE Tumbleweed |
openSUSE Leap 15.1 |
openSUSE Leap 15.0 |
SUSE Linux Enterprise Server 15 |
SUSE Linux Enterprise Server 12 |
Comment anonymously. Login not required.