Proper Way to Setup Netplan YAML File Permission

<p>Let&rsquo;s dive in and check how to fix these warnings !<br /> According to the message, it means that we have given too much permission which can allow non-root user to get the file content.</p> <p>By checking the official documentation&nbsp;<a href="https://netplan.readthedocs.io/en/stable/reference/" rel="noopener ugc nofollow" target="_blank">(ref)</a>&nbsp;, they suggest only given read-write to&nbsp;<code>root</code>&nbsp;user only, which comes with&nbsp;<strong><em>600</em></strong>&nbsp;for the command option of&nbsp;<code>chmod</code>&nbsp;.</p> <blockquote> <p>Netplan&rsquo;s configuration files use the&nbsp;<a href="http://yaml.org/spec/1.1/current.html" rel="noopener ugc nofollow" target="_blank">YAML (v1.1)</a>&nbsp;format. All files in&nbsp;<code>/{lib,etc,run}/netplan/*.yaml</code>&nbsp;are considered and are supposed to use restrictive file permissions (<code>600</code>&nbsp;/&nbsp;<code>rw-------</code>), i.e. owner (root) read-write only.</p> </blockquote> <h1>Before</h1> <p>As the following console output, we found that the YAML files are along with permission 644 which give read operation for user, that&rsquo;s the cause for the warnings.</p> <p><a href="https://jason19970210.medium.com/proper-way-to-setup-netplan-yaml-file-permission-867da8eb026a"><strong>Visit Now</strong></a></p>
Tags: Netplan YAML