当我这样做时sudo netplan apply
,它会显示权限警告。以下是终端显示的完全相同的消息。
** (generate:2496): WARNING **: 05:24:24.943: Permissions for /etc/netplan/00-installer-config.yaml are too open. Netplan configuration should NOT be accessible by others.
** (generate:2496): WARNING **: 05:24:24.943: Permissions for /etc/netplan/01-network-manager-all.yaml are too open. Netplan configuration should NOT be accessible by others.
Cannot call openvswitch: ovsdb-server.service is not running.
** (process:2494): WARNING **: 05:24:25.215: Permissions for /etc/netplan/00-installer-config.yaml are too open. Netplan configuration should NOT be accessible by others.
** (process:2494): WARNING **: 05:24:25.215: Permissions for /etc/netplan/01-network-manager-all.yaml are too open. Netplan configuration should NOT be accessible by others.
** (process:2494): WARNING **: 05:24:25.296: Permissions for /etc/netplan/00-installer-config.yaml are too open. Netplan configuration should NOT be accessible by others.
** (process:2494): WARNING **: 05:24:25.296: Permissions for /etc/netplan/01-network-manager-all.yaml are too open. Netplan configuration should NOT be accessible by others.
** (process:2494): WARNING **: 05:24:25.296: Permissions for /etc/netplan/00-installer-config.yaml are too open. Netplan configuration should NOT be accessible by others.
** (process:2494): WARNING **: 05:24:25.296: Permissions for /etc/netplan/01-network-manager-all.yaml are too open. Netplan configuration should NOT be accessible by others.
stat /etc/netplan/00-installer-config.yaml
:
File: /etc/netplan/00-installer-config.yaml
Size: 117 Blocks: 8 IO Block: 4096 regular file
Device: 253,0 Inode: 787924 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2023-07-10 00:36:05.082334425 +0000
Modify: 2023-06-12 09:56:02.404864248 +0000
Change: 2023-06-12 09:56:02.404864248 +0000
Birth: 2023-06-12 09:56:02.404864248 +0000
stat netplan 命令的更清晰版本:https://www.coderstool.com/cs/Yf7XHb
cat /etc/netplan/00-installer-config.yaml
:
network:
ethernets:
enp0s1:
dhcp4: true
version: 2
更清晰的片段:https://www.coderstool.com/cs/3HwyVa
我继续执行了“sudo systemctl start isc-dhcp-server”、“sudo systemctl enable isc-dhcp-server”,然后是“sudo systemctl status isc-dhcp-server”。以下是命令的结果。
答案1
sudo chmod 600 /etc/netplan/your_config_file.yaml
应该可以解决您的问题。对警告中列出的每个 netplan 文件执行此操作。