Ubuntu 18.04通過文件*/etc/hostname*修改主機名後,重啓失敗該怎麼解決?
- 首先修改*/etc/cloud/cloud.cfg文件中的preserve_hostname*屬性,改爲
true
。
vim /etc/cloud/cloud.cfg
-- 修改屬性
preserve_hostname: true
- 修改
/etc/hostname
文件中的文件名
vim /etc/hostname
-- 修改系統名爲你想要的系統名
hostname
-
重啓系統
reboot
-
查看主機名
hostname