How to Change hostname in Oracle Linux 7
在Oracle Linux7中透過修改/etc/sysconfig/network這種方式並不能修改Oracle Linux 7的主機名。為了對Oracle Linux 7修改主機名,可以透過執行以下任何一種方法來實現:
1.使用主機名控制工具(hostnamectl)
2.使用網路管理命令列工具(nmcli)
3.編輯/etc/hostname檔案
1.使用主機名控制工具(hostnamectl),它是systemd-hostnamed服務的命令列工具
獲取當前主機名:
[root@jytest ~]# hostnamectl status Static hostname: jytest Icon name: computer Chassis: n/a Machine ID: 66203d1dd6f54e5da356f986ac82f473 Boot ID: e8ca08f1d73347358f085a6d0f5ed201 Virtualization: vmware Operating System: Oracle Linux Server 7.1 CPE OS Name: cpe:/o:oracle:linux:7:1 Kernel: Linux 3.8.13-55.1.6.el7uek.x86_64 Architecture: x86_64
修改主機名:
[root@jytest ~]# hostnamectl set-hostname jytest3
重新登入獲取當前主機名可以看到主機名已經變成了jytest3
[root@jytest3 ~]# hostnamectl status Static hostname: jytest3 Icon name: computer Chassis: n/a Machine ID: 66203d1dd6f54e5da356f986ac82f473 Boot ID: e8ca08f1d73347358f085a6d0f5ed201 Virtualization: vmware Operating System: Oracle Linux Server 7.1 CPE OS Name: cpe:/o:oracle:linux:7:1 Kernel: Linux 3.8.13-55.1.6.el7uek.x86_64 Architecture: x86_64
2.使用網路管理命令列工具(nmcli)
獲取當前主機名
[root@jytest3 ~]# nmcli general hostname jytest3
修改主機名並重新啟動systemd-hostnamed服務
[root@jytest3 ~]# nmcli general hostname jytest2 [root@jytest3 ~]# systemctl restart systemd-hostnamed
重新登入並檢查當前主機名
[root@jytest2 ~]# hostname jytest2
3.編輯/etc/hostname檔案
獲取當前主機名
[root@jytest2 ~]# cat /etc/hostname jytest2
修改主機名
[root@jytest2 ~]# echo "jytest1" > /etc/hostname [root@jytest2 ~]# cat /etc/hostname jytest1
重啟系統並檢查主機名
[root@jytest2 ~]# reboot [root@jytest1 ~]# hostname jytest1 [root@jytest1 ~]# cat /etc/hostname jytest1
引用:How to Configure hostname in Oracle Linux 7 (Doc ID 2049221.1)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26015009/viewspace-2134867/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- How to change VIP and VIP/Hostname in 10g
- Oracle Linux 7 修改 hostnameOracleLinux
- How to change the APPS db password in Oracle EBSAPPOracle
- How to Change IP and VIP in Oracle Clusterware(一)-概念篇Oracle
- How to Change IP and VIP in Oracle Clusterware(二)-實操篇Oracle
- How to change the background color for PyCharmPyCharm
- How to Change Interconnect/Public Interface IP or Subnet in Oracle ClusterwareOracle
- How To Change The Asm Rebalancing PowerASM
- How to Change RabbitMQ Queue Parameters in Production?MQ
- How To Change UNIX Process Resource LimitsMIT
- How To Change The Oracle Hidden Parameters In Oracle 10g [ID 315631.1]Oracle 10g
- How to change the implementation (detour) of an externally declared functionFunction
- linux 配置hostnameLinux
- Linux修改hostnameLinux
- linux的hostname修改Linux
- hostname修改理解心得-linuxLinux
- How to Rename Database/Change DB_NAME or ORACLE_SID/Instance Name-15390.1DatabaseOracle
- Linux 修改主機名(hostname)Linux
- 深入理解Linux修改hostnameLinux
- How to change Public VIP Address in 11gR2 RAC
- How to change Volume Licence Key for Windows XP and 2003Windows
- Linux change date timeLinux
- <Linux系統hostname命令詳解>Linux
- 修改Linux主機名Hostname (整理)Linux
- Oracle ASM Active Change DirectoryOracleASM
- How to Change Default Web ADI Upload Parameters for FlexField Import / ValidationWebFlexImport
- How to change the password for win2003 via remote desktopREM
- How Oracle Works!Oracle
- How to Study OracleOracle
- How to disable transparent hugepages (THP) on Red Hat Enterprise Linux 7Linux
- How to Set Device Name Using UDEV on Oracle Linux 7.1devOracleLinux
- linux 修改hosts檔案以及修改hostnameLinux
- 新版本linux更新hostname的方法Linux
- Linux下 /etc/hostname 格式及解釋Linux
- oracle 的 BLOCK CHANGE TRACKINGOracleBloC
- Oracle Block Change Tracking功能OracleBloC
- ORACLE SQL DEVELOPER User Interface ChangeOracleSQLDeveloper
- ORACLE_HOSTNAME 未定義,em重新配置Oracle