Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pytest_fixtures/component/templatesync.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def git_pub_key(session_target_sat, git_port):
id = res.json()['id']
# add ssh key to known host
session_target_sat.execute(
f'ssh-keyscan -4 -t rsa -p {git.ssh_port} {git.hostname} > {key_path}/known_hosts'
f"sudo -u foreman sh -c 'ssh-keyscan -t rsa -p {git.ssh_port} {git.hostname} >> {key_path}/known_hosts'"
Copy link
Contributor Author

@lpramuk lpramuk Dec 19, 2025

Choose a reason for hiding this comment

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

Fixes three problems:

  1. -4 - dont always use ipv4, especially on ipv6
  2. sudo -u foreman ... - .ssh/known_hosts file should be owned by user foreman not root
  3. >> {key_path}/known_hosts - .ssh/known_hosts file may contain multiple entries, append new entry

)
yield
res = requests.delete(
Expand Down