From 9fcf2e1251115af4fe59cc64453ffb50b5afd123 Mon Sep 17 00:00:00 2001
From: Jonas Bardino
+You can connect with ssh as user %s on host %s and port %d.
+
"""
jump_msg = """Please note that you MUST explicitly ssh jump through host
%(fqdn)s as user %(user)s to reach the instance.
- """
+
"""
jump_host = cloud_login_jump_host(configuration, client_id, cloud_id)
fqdn = cloud_fqdn_from_ip(configuration, address)[0]
username = cloud_login_username(configuration, cloud_id, image)
msg = base_msg % (username, fqdn, port)
jump_opt = ''
ssh_config = """Host %s
-HostName %s
-User %s
-# Path to your ssh private key matching pub key set on your Cloud Setup page
-IdentityFile ~/.ssh/id_rsa
-IdentitiesOnly yes
+ Hostname %s
+ User %s
+ # Path to your ssh private key matching pub key set on your Cloud Setup page
+ IdentityFile ~/.ssh/id_rsa
+ IdentitiesOnly yes
""" % (label, fqdn, username)
if jump_host['fqdn']:
msg += jump_msg % jump_host
jump_opt = "-J%(user)s@%(fqdn)s" % jump_host
- ssh_config += """ProxyJump %(user)s@%(fqdn)s
+ ssh_config += """ ProxyJump %(hostalias)s
+
+Host %(hostalias)s %(fqdn)s
+ Hostname %(fqdn)s
+ User %(user)s
+ # Path to your ssh private key matching pub key set on your Cloud Setup page
+ IdentityFile ~/.ssh/id_rsa
""" % jump_host
msg += """Example explicit ssh command:
+
+
+
ssh %s %s@%s
+
+
Alternatively you can add something like: +
+
%s
-to your ~/.ssh/config to allow the simple ssh command:
+
+
+to your ~/.ssh/config to allow connecting with the simple ssh command:
+
+
ssh %s
+
+
+
""" % (ssh_config, label)
return msg
diff --git a/mig/shared/functionality/reqcloudservice.py b/mig/shared/functionality/reqcloudservice.py
index 7885544fd..f9a466bb7 100644
--- a/mig/shared/functionality/reqcloudservice.py
+++ b/mig/shared/functionality/reqcloudservice.py
@@ -109,8 +109,7 @@ def _ssh_help(configuration, client_id, cloud_id, cloud_dict,
image = cloud_dict.get('INSTANCE_IMAGE', 'UNKNOWN')
msg = cloud_ssh_login_help(configuration, client_id, cloud_id, label,
address, port, image)
- # Wrap lines as html
- return msg.replace('\n', '