GNU/Linux >> Linux Esercitazione >  >> Linux

Come modificare un nome host statico su Linux RHEL7 con hostnamectl

Invece di modificare manualmente un nome host sul tuo server Redhat 7 modificando /etc/hostname puoi preferibilmente usare un comando dedicato hostnamectl per fare questo lavoro. Per impostazione predefinita, quando non vengono fornite altre opzioni, hostnamectl il comando visualizzerà le informazioni di base incluso il nome host statico:

[root@rhel7 ~]# hostnamectl 
   Static hostname: rhel7
         Icon name: computer
           Chassis: n/a
        Machine ID: 75387b56d72b44b380810499805ec28a
           Boot ID: 6ad251d0e12a10e3af1894eae5fe5cb6
    Virtualization: oracle
  Operating System: Red Hat Enterprise Linux Server 7.0 (Maipo)
       CPE OS Name: cpe:/o:redhat:enterprise_linux:7.0:GA:server
            Kernel: Linux 3.10.0-123.el7.x86_64
      Architecture: x86_64

Usa set-hostname nome host del sistema di modifica dell'opzione. Di seguito forniremo rhel7-web argomento per cambiare il nome host in rhel7-web .

[root@rhel7 ~]# hostname
rhel7
[root@rhel7 ~]# hostnamectl set-hostname rhel-web
[root@rhel7 ~]# hostname
rhel-web

Il hostnamectl comando aveva cambiato automaticamente un contenuto di /etc/hostname :

[root@rhel7 ~]# cat /etc/hostname 
rhel-web

Linux
  1. Come modificare un nome host in Linux

  2. Come modificare una locale di sistema su RHEL7 Linux

  3. Come modificare un fuso orario su un server Linux RHEL7

  4. Come aggiungere un nuovo percorso statico su RHEL7 Linux

  5. Come impostare o modificare il nome host del sistema in Linux

Come modificare il nome host su Debian 10 Linux

Come impostare o modificare il nome host in Linux

Come impostare o modificare il nome host su Linux

Come cambiare il tuo nome host in Linux

Come modificare il nome host su Debian Linux

Come modificare nome utente e nome host su sistema Linux