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 the background color for PyCharmPyCharm
- linux 配置hostnameLinux
- centos7修改hostnameCentOS
- How to disable transparent hugepages (THP) on Red Hat Enterprise Linux 7Linux
- How to Install ClamAV on CentOS 7CentOS
- 新版本linux更新hostname的方法Linux
- linux 修改hosts檔案以及修改hostnameLinux
- How Oracle Store Number internal(zt)Oracle
- 【Autofs】How to Configure Autofs on CentOS 7?CentOS
- How to Install VirtualBox 5.2 on CentOS 7CentOS
- How to Install EMC PowerPath on Oracle VM 3.4Oracle
- Linux基礎命令—顯示主機名hostnameLinux
- Linux基礎命令---顯示主機名hostnameLinux
- linux CentOS6.x 修改主機名(Hostname)LinuxCentOS
- How to Install and Secure Redis on Centos7RedisCentOS
- How to Install and Configure VNC Server in CentOS 7VNCServerCentOS
- Oracle redo解析之-3、常見change分析Oracle Redo
- linux7 開機自啟動oracleLinuxOracle
- oracle linux 7 安裝圖形化介面OracleLinux
- How To Deal With Split Brain In Oracle 19c RacAIOracle
- location.hostname
- Oracle Linux 7使用syslog來管理Oracle ASM的審計檔案OracleLinuxASM
- How to Add a New Disk new partition in centos7CentOS
- Oracle 12.2 How to Generate AWRs in Active Data Guard Standby DatabasesOracleDatabase
- Oracle Linux 7設定中文字符集OracleLinux
- ubuntu 18.04 更改 hostnameUbuntu
- URL hostname 屬性
- [20221222]How to Enable and Disable Database Options in oracle 11g.txtDatabaseOracle
- How To Deal With Split Brain In Oracle 19c Rac-202203AIOracle
- How To Replicate Data from Oracle to Postgres Using GoldenGate (Doc ID 1544137.1OracleGo
- Oracle Linux 7使用cron來管理Oracle ASM審計檔案目錄的增長OracleLinuxASM
- sqlserver Change Data Capture&Change TrackingSQLServerAPT
- Ubuntu18.04 修改hostnameUbuntu
- anacond 或python3 報check_hostname requires server_hostname錯誤PythonUIServer
- How to disable transparent Hugepage (THP) on Red Hat Enterprise Linux 8?Linux
- Oracle Linux7下部署oralce 11gr2 dataguardOracleLinux
- Oracle Linux 7.1中安裝達夢資料庫DM7OracleLinux資料庫
- 7 Oracle 函式Oracle函式
- Oracle 18C,19C standby CHECKPOINT_CHANGE# 不更新問題Oracle