Skip to content

Conversation

@shuiqingliu
Copy link
Contributor

@shuiqingliu shuiqingliu commented Jun 11, 2024

Fixes #10261

Motivation

Implement SSH key-based authentication when installing the agent via SSH.

The implementation plan is as follows:

  1. On the dashboard node, add an option to distinguish between username/password and SSH key authentication when selecting the SSH method. For SSH key authentication, the user also needs to input the username, port, and IP information.
  2. When the user selects SSH key authentication, the dashboard actively calls the SSH key retrieval interface.
  3. If the manager node does not have an SSH key pair, it calls ssh-keygen to generate one. If a key pair already exists, it is returned directly.
  4. When executing the installation command, if no user password is provided, the installation defaults to using SSH key authentication.

Modifications

  • Added an SSH key generation interface.
  • Modified the remote command execution method to support SSH key authentication.
  • When the user authenticates via SSH key, the password is empty, so the remote command execution method was modified to support nullable parameters.

Verifying this change

(Please pick either of the following options)

  • This change is a trivial rework/code cleanup without any test coverage.
  • This change is already covered by existing tests, such as:
  • Tested SSH key generation; the key was generated successfully.
image
  • Tested command execution via SSH key; the execution was successful.
  • This change added tests and can be verified as follows:

Documentation

  • Does this pull request introduce a new feature? yes
  • If yes, how is the feature documented? (not documented)

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @shuiqingliu, thank you for submitting a PR to InLong 💖 We will respond as soon as possible ⏳
This seems to be your first PR 🌠 Please be sure to follow our Contribution Guidelines.
If you have any questions in the meantime, you can also ask us on the InLong Discussions 🔍

@aloyszhang aloyszhang changed the title [INLONG-10261][Manager] Support installing agents by SSH key-based au… [INLONG-10261][Manager] Support installing agents by SSH key-based authentication Jun 12, 2024
@aloyszhang aloyszhang added this to the 1.13.0 milestone Jun 12, 2024
@aloyszhang aloyszhang requested a review from fuweng11 June 12, 2024 02:18
justinwwhuang
justinwwhuang previously approved these changes Jun 12, 2024
fuweng11
fuweng11 previously approved these changes Jun 13, 2024
@dockerzhang dockerzhang merged commit e3d2b8d into apache:master Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature][Manager] Support installing agents by SSH key-based authentication

5 participants