编辑/etc/hostname文件
vim /etc/hostname
文件内容修改成自己想要的名称。 修改完后,重启机器就生效了。
sudo reboot
https://www.cyberciti.biz/faq/ubuntu-change-hostname-command/