Skip to content

fix(ssh): Ensure that the private key ends with a newline character#1073

Merged
GT-610 merged 2 commits intolollipopkit:mainfrom
GT-610:ssh-format-fix
Mar 18, 2026
Merged

fix(ssh): Ensure that the private key ends with a newline character#1073
GT-610 merged 2 commits intolollipopkit:mainfrom
GT-610:ssh-format-fix

Conversation

@GT-610
Copy link
Collaborator

@GT-610 GT-610 commented Mar 18, 2026

Resolve #499.

Fixes an issue where SSH private key files were not written with a newline character at the end, preventing parsing errors in certain SSH clients

Update the package

Summary by CodeRabbit

  • Bug Fixes
    • Generated SSH private keys now include a trailing newline and are saved with secure file permissions on non-Windows systems.
  • Behavior
    • SSH invocation now handles additional command arguments in the correct order to improve connection reliability.
  • Chores
    • Updated a subproject reference with no user-facing API changes.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 6bc42c47-91b3-4957-bef6-97f123a32a63

📥 Commits

Reviewing files that changed from the base of the PR and between 7c7b863 and 2b835ae.

📒 Files selected for processing (2)
  • lib/view/widget/server_func_btns.dart
  • packages/computer
✅ Files skipped from review due to trivial changes (1)
  • packages/computer
🚧 Files skipped from review as they are similar to previous changes (1)
  • lib/view/widget/server_func_btns.dart

📝 Walkthrough

Walkthrough

The changes update SSH-related behavior in lib/view/widget/server_func_btns.dart: when generating a private key file the code ensures the key content ends with a trailing newline and sets file permissions to 0600 on non-Windows platforms after writing. SSH command assembly is modified to place user@host at the end of the argument list (['ssh'] + extraArgs + ['user@host']). Minor whitespace edits and a submodule commit addition for packages/computer were also included.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The SSH command parameter reordering change is not directly related to the primary objective of ensuring trailing newlines in private keys and may introduce unintended behavioral changes. Clarify whether the SSH command parameter reordering is necessary for the key parsing fix or if it should be addressed separately.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: ensuring private keys end with a newline character, which directly addresses the issue of SSH key parsing failures.
Linked Issues check ✅ Passed The code changes add trailing newline to private keys and set file permissions on non-Windows platforms, directly addressing the SSH key parsing error reported in issue #499.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai bot requested a review from lollipopkit March 18, 2026 04:13
coderabbitai[bot]
coderabbitai bot previously approved these changes Mar 18, 2026
Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

chatgpt-codex-connector[bot]

This comment was marked as resolved.

Fixes an issue where SSH private key files were not written with a newline character at the end, preventing parsing errors in certain SSH clients

Update the package
coderabbitai[bot]

This comment was marked as resolved.

…arameters and added file permission settings

Added permission settings for private key files on non-Windows platforms to ensure secure access. Additionally, the order of SSH command parameters was adjusted to ensure that connection parameters are passed correctly.
@GT-610 GT-610 merged commit 713662d into lollipopkit:main Mar 18, 2026
1 of 2 checks passed
@GT-610 GT-610 deleted the ssh-format-fix branch March 18, 2026 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

windows ssh使用密钥登录出现问题

1 participant