title: How to replace /root/.ssh/authorized_keys with cloud-config on EC2?
body: <p>When deploying a new EC2 instance you have to select an SSH key to give access to the machine. I would like to use <em>only</em> the authorised keys specified in the user data for an instance. Is this possible? I've tried using both <code>ssh-authorized-keys</code>:</p>
  
  <pre><code>users:
    - name: user
      ssh-authorized-keys:
        - ssh-rsa [...] my_key
  </code></pre>
  
  <p>and <code>write_files</code>:</p>
  
  <pre><code>write_files:
    - content: |
          ssh-rsa [...] my_key
      path: /home/user/.ssh/authorized_keys
  </code></pre>
  
  <p>, but in both cases the original key is added to <code>/root/.ssh/authorized_keys</code> automatically. Do I need to disable <code>root</code> login to disable this key permanently?</p>