| From a2bffa7844c1ef811dc392549ba024b68464a1ae Mon Sep 17 00:00:00 2001 |
| From: Wei Xu <weixugc@google.com> |
| Date: Wed, 4 Mar 2020 10:27:40 -0800 |
| Subject: [PATCH] Skip applying ssh keys to 'root'. |
| |
| /root is read-only on COS. Skip applying the ssh keys to 'root' |
| to avoid unnecessary error messages. |
| --- |
| cloudinit/config/cc_ssh.py | 3 +++ |
| 1 file changed, 3 insertions(+) |
| |
| diff --git a/cloudinit/config/cc_ssh.py b/cloudinit/config/cc_ssh.py |
| index 050285a8..fc09fe15 100755 |
| --- a/cloudinit/config/cc_ssh.py |
| +++ b/cloudinit/config/cc_ssh.py |
| @@ -234,6 +234,8 @@ def apply_credentials(keys, user, disable_root, disable_root_opts): |
| if user: |
| ssh_util.setup_user_keys(keys, user) |
| |
| + # Don't apply the ssh keys to 'root' because /root is read-only on COS. |
| + """ |
| if disable_root: |
| if not user: |
| user = "NONE" |
| @@ -243,6 +245,7 @@ def apply_credentials(keys, user, disable_root, disable_root_opts): |
| key_prefix = '' |
| |
| ssh_util.setup_user_keys(keys, 'root', options=key_prefix) |
| + """ |
| |
| |
| def get_public_host_keys(blacklist=None): |
| -- |
| 2.25.1.481.gfbce0eb801-goog |
| |