Proper Way to Setup Netplan YAML File Permission
<p>Let’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 <a href="https://netplan.readthedocs.io/en/stable/reference/" rel="noopener ugc nofollow" target="_blank">(ref)</a> , they suggest only given read-write to <code>root</code> user only, which comes with <strong><em>600</em></strong> for the command option of <code>chmod</code> .</p>
<blockquote>
<p>Netplan’s configuration files use the <a href="http://yaml.org/spec/1.1/current.html" rel="noopener ugc nofollow" target="_blank">YAML (v1.1)</a> format. All files in <code>/{lib,etc,run}/netplan/*.yaml</code> are considered and are supposed to use restrictive file permissions (<code>600</code> / <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’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>