linux修改主机名和IP地址-Ubuntu18.04
Ubuntu18.04修改主机名
修改cloud.cfg防止重启后主机名还原
vim /etc/cloud/cloud.cfg
# 将preserve_hostname的值改为true
preserve_hostname:true
修改主机名
# 修改主机名
hostnamectl set-hostname services
# 配置hosts 顺序执行这三行
cat >> /etc/hosts << EOF
192.168.84.130 services
EOF
U
原创
2020-11-05 16:09:23 ·
2540 阅读 ·
0 评论