-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[SSH] Add RDP over SSH feature #5003
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
Conversation
|
SSH |
| if not os.path.isfile(rdp_path): | ||
| raise azclierror.BadRequestError("Could not find " + rdp_command + ".exe. Is the rdp client installed?") | ||
| else: | ||
| raise azclierror.BadRequestError("Platform is not supported for this command. Supported platforms: Windows") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we potentially make this cross-platform by calling the address using the rdp:// protocol handler instead of calling the .exe directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zhoxing-ms if we cannot make this cross-platform, is there some way to only show the parameter on Windows machines and not on Mac/Linux?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jiasli Do you have any suggestions on this question?
|
|
||
| op_call = ssh_utils.start_ssh_connection | ||
| if winrdp: | ||
| if platform.system() != 'Windows': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to confirm with you that the judgment here does not need to ignore the case of platform.system()?
src/ssh/azext_ssh/rdp_utils.py
Outdated
| def print_error_messages_from_log(log_list, print_ssh_logs, ssh_process, terminated): | ||
| # Read the remaining log messages since the connection was established. | ||
| next_line = ssh_process.stderr.readline() | ||
| while next_line: | ||
| if print_ssh_logs: | ||
| print(next_line, end='') | ||
| else: | ||
| log_list.append(next_line) | ||
| next_line = ssh_process.stderr.readline() | ||
|
|
||
| # If ssh process was not forced to terminate, print potential error messages. | ||
| if ssh_process.returncode != 0 and not print_ssh_logs and not terminated: | ||
| for line in log_list: | ||
| if "debug1:" not in line and line != '': | ||
| print(str(line)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print_error_messages_from_log
If you are printing the error messages, why not use the log.error?
Add a new parameter --rdp/--winrdp that uses port forwarding to allow users to create RDP connections over the SSH connection created by the extension.
This is useful for costumers who want to connect to their Azure Arc Servers via RDP using the Arc Connectivity Platform.
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally?For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.jsonautomatically.The precondition is to put your code inside this repository and upgrade the version in the pull request but do not modify
src/index.json.