me80

操作环境:

[root@bogon ~]# uname -a
Linux #localhost.localdomain 3.10.0-514.el7.centos.plus.i686 #1 SMP Wed Jan 25 12:55:04 UTC 2017 i686 i686 i386 GNU/Linux
[root@bogon ~]# cat /etc/redhat-release 
CentOS release 7.3.1611 (AltArch) 
[root@bogon ~]# 

实验要求:将centos7原主机名改为\'NMserver-7.test.com\'

1、方法一使用hostnamectl命令

[root@bogon ~]# hostnamectl set-hostname  NMServer-7.test.com

 

 

2、方法二:修改配置文件  /etc/hostname 保存退出

[root@bogon ~]# vi /etc/hostname 

nmserver-7.test.com
~                                                                                                                                                            
~                                                                                                                                                            
~                                                                                                                                                            
~                                                                                                                                                            
                                                                                                                                                          
:wq
[root@bogon ~]# reboot

 

分类:

技术点:

相关文章:

  • 2022-02-17
  • 2021-06-21
  • 2021-11-18
  • 2022-02-07
  • 2021-12-18
  • 2021-09-25
猜你喜欢
  • 2022-02-13
  • 2021-09-19
  • 2022-02-07
  • 2021-12-18
  • 2022-02-07
相关资源
相似解决方案