Example:将bogon 改为 adelababy
Oracle Linux 6.5
[[email protected] ~]# hostname
bogon
[[email protected] ~]# hostname adelababy
[[email protected] ~]# hostname
adelababy
[[email protected] ~]# vim /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=adelababy
[[email protected] ~]# reboot
[[email protected] Desktop]# hostname
adelababy
[[email protected] Desktop]# vim /etc/hosts
127.0.0.1 localhost adelababy
[[email protected] Desktop]# ping adelababy
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.025 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.069 ms
RHEL 7.0
#sethostname adelababy
#hostname
hostname 的更改 Oracle Linux 6.5 && RHEL 7.0
时间: 2024-10-12 11:27:22