Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ssh] Bug Fix: Change how ssh vm reads the ssh client logs #5366

Merged
merged 10 commits into from
Oct 21, 2022
4 changes: 4 additions & 0 deletions src/ssh/HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Release History
===============
1.1.3
-----
* [bug fix] SSH Banners are printed before authentication.

1.1.2
-----
* Remove dependency to cryptography (Az CLI core alredy has cryptography)
Expand Down
2 changes: 1 addition & 1 deletion src/ssh/azext_ssh/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def _do_ssh_op(cmd, op_info, op_call):
op_info.private_key_file + ', ' if delete_keys else "",
op_info.public_key_file + ', ' if delete_keys else "",
op_info.cert_file if delete_cert else "")
ssh_utils.do_cleanup(delete_keys, delete_cert, op_info.cert_file,
ssh_utils.do_cleanup(delete_keys, delete_cert, op_info.delete_credentials, op_info.cert_file,
op_info.private_key_file, op_info.public_key_file)
raise e

Expand Down
8 changes: 4 additions & 4 deletions src/ssh/azext_ssh/rdp_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ def start_rdp_connection(ssh_info, delete_keys, delete_cert):
ssh_process, print_ssh_logs = start_ssh_tunnel(ssh_info)
ssh_connection_t0 = time.time()
ssh_success, log_list = wait_for_ssh_connection(ssh_process, print_ssh_logs)
ssh_utils.do_cleanup(delete_keys, delete_cert, ssh_info.cert_file, ssh_info.private_key_file,
ssh_info.public_key_file)
ssh_utils.do_cleanup(delete_keys, delete_cert, ssh_info.delete_credentials, ssh_info.cert_file,
ssh_info.private_key_file, ssh_info.public_key_file)
if ssh_success and ssh_process.poll() is None:
call_rdp(local_port)

Expand All @@ -56,8 +56,8 @@ def start_rdp_connection(ssh_info, delete_keys, delete_cert):
telemetry.add_extension_event('ssh', ssh_connection_data)

terminate_ssh(ssh_process, log_list, print_ssh_logs)
ssh_utils.do_cleanup(delete_keys, delete_cert, ssh_info.cert_file, ssh_info.private_key_file,
ssh_info.public_key_file)
ssh_utils.do_cleanup(delete_keys, delete_cert, ssh_info.delete_credentials, ssh_info.cert_file,
ssh_info.private_key_file, ssh_info.public_key_file)
if delete_keys:
# This is only true if keys were generated, so they must be in a temp folder.
temp_dir = os.path.dirname(ssh_info.cert_file)
Expand Down
Loading