Linux-redhat7.1 change the hostname

Dry goods directly to the system as a demonstration redhat7.1

After entering the host name system queries the current system

hotsname

[root@ISCSI ~]# hostname
ISCSI

View profile hostname

cat /etc/hostname

[root@ISCSI ~]# cat /etc/hostname
ISCSI

Modify the hostname

vim /etc/hostname

[root@ISCSI ~]# vim /etc/hostname
Note: vim, after opening the file, press the keyboard i, enter edit mode, ISCSI modify this field, the default is localhost, I became ISCSI modify, edit When finished, press the esc key, then press: Enter wq, save and exit

After modifying the hostname reboot

reboot

View name after restart

[root@OANFS ~]# hostname
OANFS

Reproduced in: https: //www.jianshu.com/p/87ce81a216c5

Guess you like

Origin blog.csdn.net/weixin_33885676/article/details/91160465