Oracle Linux 7 修改 hostname
Linux修改hostname的常用操作方法是——手工在/etc/sysconfig/network中追加"HOSTNAME=xxxxx"並重啟系統,這個方法在Oracle Linux 7中是不生效的。
那麼在Oracle Linux 7中怎麼配置hostname?
來源於:
How to Configure hostname in Oracle Linux 7 (Doc ID 2049221.1)
解決方案:
請使用如下三種方法的任意一種來修改Oracle Linux 7中的主機名
1. use hostname control utility: hsotnamectl
2. use NetworkManager command line tool: nmcli
3. edit /etc/hostname file directly (a reboot afterwards is required)
那麼在Oracle Linux 7中怎麼配置hostname?
來源於:
How to Configure hostname in Oracle Linux 7 (Doc ID 2049221.1)
解決方案:
請使用如下三種方法的任意一種來修改Oracle Linux 7中的主機名
1. use hostname control utility: hsotnamectl
2. use NetworkManager command line tool: nmcli
3. edit /etc/hostname file directly (a reboot afterwards is required)
1. Use hsotnamectl which is a command-line client to systemd-hostnamed service
Get current hostname status:
[root@localhost ~]# hostnamectl status
Static hostname: localhost.localdomain
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
Static hostname: localhost.localdomain
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
Set hostname:
[root@localhost ~]# hostnamectl set-hostname oraclelinux.oracle.com
[root@localhost ~]#
[root@localhost ~]#
Re-login terminal session:
[root@oraclelinux ~]# hostnamectl status
Static hostname: oraclelinux.oracle.com
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
Static hostname: oraclelinux.oracle.com
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
Check current hostname:
[root@localhost ~]# nmcli general hostname
localhost.localdomain
localhost.localdomain
Modify hostname and restart ystemd-hostnamed service:
[root@localhost ~]# nmcli general hostname oraclelinux.oracle.com
[root@localhost ~]# systemctl restart systemd-hostnamed
[root@localhost ~]# systemctl restart systemd-hostnamed
Re-login terminal session:
[root@oraclelinux ~]# hostname
oraclelinux.oracle.com
oraclelinux.oracle.com
3. Edit /etc/hostname
View current content:
[root@localhost ~]# cat /etc/hostname
localhost.localdomain
localhost.localdomain
Replace file content with new hostname:
[root@localhost ~]# echo "oraclelinux.oracle.com" > /etc/hostname
[root@localhost ~]# cat /etc/hostname
oraclelinux.oracle.com
[root@localhost ~]# cat /etc/hostname
oraclelinux.oracle.com
Restart system and verify:
[root@oraclelinux ~]# hostname
oraclelinux.oracle.com
oraclelinux.oracle.com
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/12707874/viewspace-2140997/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- centos7修改hostnameCentOS
- linux 修改hosts檔案以及修改hostnameLinux
- linux CentOS6.x 修改主機名(Hostname)LinuxCentOS
- Ubuntu18.04 修改hostnameUbuntu
- linux 配置hostnameLinux
- Linux 7 修改時區不生效Linux
- 新版本linux更新hostname的方法Linux
- Linux基礎命令—顯示主機名hostnameLinux
- Linux基礎命令---顯示主機名hostnameLinux
- linux7 開機自啟動oracleLinuxOracle
- oracle linux 7 安裝圖形化介面OracleLinux
- Linux7修改主機IP及主機名Linux
- location.hostname
- Oracle Linux 7使用syslog來管理Oracle ASM的審計檔案OracleLinuxASM
- Oracle Linux 7設定中文字符集OracleLinux
- Oracle修改時區Oracle
- oracle nid修改dbnameOracle
- ubuntu 18.04 更改 hostnameUbuntu
- URL hostname 屬性
- Linux系統Centos7修改或重置root密碼教程。LinuxCentOS密碼
- Oracle Linux 7使用cron來管理Oracle ASM審計檔案目錄的增長OracleLinuxASM
- Oracle 字符集修改Oracle
- anacond 或python3 報check_hostname requires server_hostname錯誤PythonUIServer
- Oracle Linux7下部署oralce 11gr2 dataguardOracleLinux
- oracle ora-00333 修改案例Oracle
- Oracle 增加 修改 刪除 列Oracle
- Linux修改時間Linux
- Linux 修改時間Linux
- Oracle Linux 7.1中安裝達夢資料庫DM7OracleLinux資料庫
- 7 Oracle 函式Oracle函式
- Centos7 修改SSH 埠CentOS
- CentOS7 修改 yum 源CentOS
- Oracle RAC修改public, VIP, SCAN IPOracle
- ordebug 手動修改Oracle sga scnOracle
- 修改oracle 的統計資訊Oracle
- oracle11g在linux7的靜默安裝指令碼OracleLinux指令碼
- host=wwwtl555222com17008768000-HOSTNAME
- linux 修改swap空間Linux
- linux核心修改編譯Linux編譯