Ubuntu Server có phát triển công cụ riêng để cấu hình mạng là netplan.
Địa chỉ IP, subnet mask, default gateway, dns server kèm theo tên card mạng sẽ được khai báo dạng YAML sau đó xài lệnh netplan apply để cấu hình.
netplan apply có kiểm tra quyền của các file YAML trong /etc/netplan rước khi chạy. Trường hợp này 50-cloud-init.yaml có quyền quá cao là 755 nên sẽ có cảnh báo sau:
# ll /etc/netplan/
total 12
drwxr-xr-x 2 root root 4096 Jan 16 23:45 ./
drwxr-xr-x 108 root root 4096 Jan 16 23:46 ../
-rwxr-xr-x 1 root root 665 Jan 16 23:45 50-cloud-init.yaml*
root@ubuntu2404:~#
root@ubuntu2404:~# netplan apply
** (generate:1418): WARNING **: 18:42:16.473: Permissions for /etc/netplan/50-cloud-init.yaml are too open. Netplan configuration should NOT be accessible by others.
** (process:1417): WARNING **: 18:42:16.633: Permissions for /etc/netplan/50-cloud-init.yaml are too open. Netplan configuration should NOT be accessible by others.
** (process:1417): WARNING **: 18:42:16.674: Permissions for /etc/netplan/50-cloud-init.yaml are too open. Netplan configuration should NOT be accessible by others.
Nếu 50-cloud-init.yaml có quyền 600 thì netplan apply sẽ chạy mà không đưa ra cảnh báo gì.
# chmod 600 /etc/netplan/50-cloud-init.yaml
root@ubuntu2404:~#
root@ubuntu2404:~# ll /etc/netplan/
total 12
drwxr-xr-x 2 root root 4096 Jan 16 23:45 ./
drwxr-xr-x 108 root root 4096 Jan 16 23:46 ../
-rw------- 1 root root 665 Jan 16 23:45 50-cloud-init.yaml
root@ubuntu2404:~#
root@ubuntu2404:~# netplan apply
root@ubuntu2404:~#