summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Howard <ben.howard@canonical.com>2015-09-11 14:04:52 -0600
committerBen Howard <ben.howard@canonical.com>2015-09-11 14:04:52 -0600
commitfd6b08c4d03b07be67398450e40e7e2f91e8db51 (patch)
tree804fb186bee1c30989c3ebc421001b77f93366e0
parent6f2b8551e72596adfc685357d8471c454bd96d63 (diff)
downloadvyos-cloud-init-fd6b08c4d03b07be67398450e40e7e2f91e8db51.tar.gz
vyos-cloud-init-fd6b08c4d03b07be67398450e40e7e2f91e8db51.zip
Refinements on SSH enablement
-rw-r--r--cloudinit/config/cc_snappy.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/cloudinit/config/cc_snappy.py b/cloudinit/config/cc_snappy.py
index e36542bf..899df10c 100644
--- a/cloudinit/config/cc_snappy.py
+++ b/cloudinit/config/cc_snappy.py
@@ -280,10 +280,12 @@ def handle(name, cfg, cloud, log, args):
# If the user has not explicitly enabled or disabled SSH, then enable it
# when password SSH authentication is requested or there are SSH keys
if mycfg.get('ssh_enabled', None) is not False:
- if len(mycfg.get('public-keys', [])) > 0:
+ user_ssh_keys = cloud.get_public_ssh_keys() or None
+ password_auth_enabled = cfg.get('ssh_pwauth', False)
+ if user_ssh_keys:
LOG.debug("Enabling SSH, user SSH keys provided")
ssh_enabled = True
- elif mycfg.get('ssh_pwauth', False):
+ elif password_auth_enabled:
LOG.debug("Enabling SSH, password authentication requested")
ssh_enabled = True