@@ -1025,9 +1025,9 @@ def _get_encoder(configuration, coding):
1025
1025
1026
1026
1027
1027
def _get_jump_host (configuration , client_id , cloud_id , manage = False ):
1028
- """Return any configured ssh jump host ssh details including address, port
1029
- and username for client_id on cloud_id. If the optional manage arg is set
1030
- the two additional manage key script and coding settings are added.
1028
+ """Return any configured ssh jump host ssh details including address, port,
1029
+ username and key for client_id on cloud_id. If the optional manage arg is
1030
+ set the two additional manage key script and coding settings are added.
1031
1031
"""
1032
1032
_logger = configuration .logger
1033
1033
jump_host = {}
@@ -1041,6 +1041,8 @@ def _get_jump_host(configuration, client_id, cloud_id, manage=False):
1041
1041
jump_host ['fqdn' ] = cloud_fqdn_from_ip (configuration , addr )[0 ]
1042
1042
jump_host ['user' ] = lookup_user_service_value (
1043
1043
configuration , client_id , service , 'service_jumphost_user' , '' )
1044
+ jump_host ['key' ] = lookup_user_service_value (
1045
+ configuration , client_id , service , 'service_jumphost_key' , '' )
1044
1046
# TODO: support jumphost port with port map override?
1045
1047
if manage :
1046
1048
for name in ('manage_keys_script' , 'manage_keys_coding' ):
@@ -1094,6 +1096,8 @@ def _manage_jump_host_keys(configuration, client_id, cloud_id, action,
1094
1096
ssh_cmd = ['ssh' ]
1095
1097
if jump_host ['user' ]:
1096
1098
ssh_cmd .append ('-oUser=%(user)s' % jump_host )
1099
+ if jump_host ['key' ]:
1100
+ ssh_cmd .append ('-oIdentityFile=%(key)s' % jump_host )
1097
1101
ssh_cmd .append ("%(fqdn)s" % jump_host )
1098
1102
# NOTE: remote script should restrict key access to reduce abuse risk with
1099
1103
# command="/bin/false",no-pty,no-agent-forwarding,no-X11-forwarding PUBKEY
0 commit comments