Ubuntu 18.04修改主機名

Ubuntu 18.04通過文件*/etc/hostname*修改主機名後,重啓失敗該怎麼解決?

  1. 首先修改*/etc/cloud/cloud.cfg文件中的preserve_hostname*屬性,改爲true
vim /etc/cloud/cloud.cfg

-- 修改屬性
preserve_hostname: true
  1. 修改/etc/hostname文件中的文件名
vim /etc/hostname

-- 修改系統名爲你想要的系統名
hostname
  1. 重啓系統
    reboot

  2. 查看主機名hostname

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章