Skip to content

Conversation

Copy link
Contributor

Copilot AI commented May 23, 2025

This PR implements the ability to sync the known_hosts file across different machines, ensuring consistent SSH host verification across systems.

Changes Made

  • Added KnownHosts field to DataDto structure to store the known_hosts file data
  • Enhanced upload functionality to read and encrypt the known_hosts file
  • Updated download process to write the known_hosts file to the user's .ssh directory
  • Added conflict resolution for known_hosts similar to existing SSH key handling
  • Created a dedicated WriteKnownHosts function with appropriate file permissions (0644)
  • Updated README to document the known_hosts syncing feature

With these changes, users will automatically have their trusted SSH hosts synchronized across machines, eliminating the need to verify host fingerprints on each device separately.

The implementation follows the existing pattern of encrypting sensitive data with the master key for secure transmission.

Fixes #53.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • cdn.fwupd.org
    • Triggering command: /usr/bin/fwupdmgr refresh (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: therealpaulgg <21159486+therealpaulgg@users.noreply.github.com>
Copilot AI changed the title [WIP] better method of syncing known_hosts file Add support for syncing known_hosts file May 23, 2025
Copilot AI requested a review from therealpaulgg May 23, 2025 01:16
@therealpaulgg
Copy link
Owner

@copilot we should add some unit tests to ensure the functionality works as expected

@therealpaulgg therealpaulgg marked this pull request as ready for review May 23, 2025 06:02
Co-authored-by: therealpaulgg <21159486+therealpaulgg@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented May 23, 2025

@copilot we should add some unit tests to ensure the functionality works as expected

I've added unit tests for the known_hosts functionality in commit ebffde7. The tests verify:

  1. The WriteKnownHosts function works correctly with proper file permissions (0644)
  2. The DataDto structure properly includes and handles the KnownHosts field
  3. The known_hosts file is created with the correct permissions (different from SSH keys)

The tests follow the existing pattern in the codebase and focus specifically on the known_hosts syncing feature.

@therealpaulgg
Copy link
Owner

@copilot I updated the releases file for gpg signing. you need to update the readme and server install instructions accordingly

Co-authored-by: therealpaulgg <21159486+therealpaulgg@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented May 27, 2025

@copilot I updated the releases file for gpg signing. you need to update the readme and server install instructions accordingly

I've updated the README with the GPG signing instructions in commit 53eb2da. The changes include:

  1. Added instructions for Linux users to install ssh-sync using the GPG-signed package repositories
  2. Updated the installation commands for both Debian and RPM-based distributions
  3. Added a new "Package Repository Setup" section in the self-hosting documentation that explains how to set up and sign your own package repository

The instructions now guide users through the proper way to add the repository and verify package signatures.

@therealpaulgg
Copy link
Owner

@copilot revert the commit, the gpg is meant for a different PR

…rent PR

Co-authored-by: therealpaulgg <21159486+therealpaulgg@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented May 27, 2025

@copilot revert the commit, the gpg is meant for a different PR

I've reverted the GPG signing instructions from the README in commit 752be9b. These changes were indeed meant for a different PR and have now been removed, keeping the focus on the known_hosts syncing functionality.

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.

better method of syncing known_hosts file

2 participants