From 11c08e00558846e7edce05d30e159c8ea2a88b95 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Fri, 24 Oct 2014 08:25:27 +1100 Subject: [PATCH] Login with 'centos' user for node launch HP Cloud centos7 images are currently failing with 'Please login as the user "centos" rather than the user "root"'. This adds the 'centos' user as one of the logins to try, and adds a little documentation to the subsequent fixup of the authorized_keys file Change-Id: I46b62c8c4aed7a1c9522d60db7f726ebcb30281c --- launch/launch-node.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/launch/launch-node.py b/launch/launch-node.py index 455b47ae52..94b634f02e 100755 --- a/launch/launch-node.py +++ b/launch/launch-node.py @@ -64,7 +64,7 @@ def bootstrap_server(server, admin_pass, key, cert, environment, name, else: ssh_kwargs['password'] = admin_pass - for username in ['root', 'ubuntu']: + for username in ['root', 'ubuntu', 'centos']: ssh_client = utils.ssh_connect(ip, username, ssh_kwargs, timeout=600) if ssh_client: break @@ -72,6 +72,9 @@ def bootstrap_server(server, admin_pass, key, cert, environment, name, if not ssh_client: raise Exception("Unable to log in via SSH") + # cloud-init puts the "please log in as user foo" message and + # subsequent exit() in root's authorized_keys -- overwrite it with + # a normal version to get root login working again. if username != 'root': ssh_client.ssh("sudo cp ~/.ssh/authorized_keys" " ~root/.ssh/authorized_keys")