Example:将bogon 改为 adelababy
Oracle Linux 6.5
[root@bogon ~]# hostname
bogon
[root@bogon ~]# hostname adelababy
[root@bogon ~]# hostname
adelababy
[root@bogon ~]# vim /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=adelababy
[root@bogon ~]# reboot
[root@adelababy Desktop]# hostname
adelababy
[root@adelababy Desktop]# vim /etc/hosts
127.0.0.1 localhost adelababy
[root@adelababy 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
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。