-
Notifications
You must be signed in to change notification settings - Fork 25
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
bug: Create SSH known_hosts
file if doesn't already exist
#915
Labels
bug
Something isn't working
Comments
nschmeller
changed the title
bug:Create SSH
bug: Create SSH Sep 21, 2022
known_hosts
file if doesn't already existknown_hosts
file if doesn't already exist
Hi @nschmeller thanks for raising this issue, I've opened a Jira on our backlog to take a look at this. |
afiune
added a commit
that referenced
this issue
Oct 5, 2022
Replicated the issue inside our unit tests: ``` === Failed === FAIL: lwrunner TestLwRunnerAddKnownHost (0.19s) runner_test.go:132: Error Trace: /Users/afiune/github/go-sdk/lwrunner/runner_test.go:132 Error: Received unexpected error: open /var/folders/pn/rtky3yx17fx60dc03njhm_fw0000gn/T/lwrunner1052124622/.ssh/known_hosts: no such file or directory Test: TestLwRunnerAddKnownHost ``` Relates to #915 Signed-off-by: Salim Afiune Maya <afiune@lacework.net>
afiune
added a commit
that referenced
this issue
Oct 5, 2022
This change fixes the issue where we try to add a known host to the known_hosts file but the directory ~/.ssh does not exist. Now we are creating that directory first. Closes #915 Jira https://lacework.atlassian.net/browse/ALLY-1195 Signed-off-by: Salim Afiune Maya <afiune@lacework.net>
afiune
added a commit
that referenced
this issue
Oct 7, 2022
**Summary** This change fixes the issue where we try to add a known host to the known_hosts file but the directory ~/.ssh does not exist. Now we are creating that directory first. **How did you test this change?** Replicated the issue inside our unit tests: ``` === Failed === FAIL: lwrunner TestLwRunnerAddKnownHost (0.19s) runner_test.go:132: Error Trace: /Users/afiune/github/go-sdk/lwrunner/runner_test.go:132 Error: Received unexpected error: open /var/folders/pn/rtky3yx17fx60dc03njhm_fw0000gn/T/lwrunner1052124622/.ssh/known_hosts: no such file or directory Test: TestLwRunnerAddKnownHost ``` **Issue** Closes #915 Jira https://lacework.atlassian.net/browse/ALLY-1195 Signed-off-by: Salim Afiune Maya <afiune@lacework.net>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Running
lacework agent install
with the flag--trust_host_key
will add the hostname to the list of known hosts if it isn't already known. If~/.ssh/known_hosts
does not exist when this command is run, the CLI will exit with status code 1 and the errorERROR unable to connect to the remote host: ssh: handshake failed: open /root/.ssh/known_hosts: no such file or directory
.To Reproduce
Steps to reproduce the behavior:
.ssh
(in this case, a container image didn't have it).lacework agent install ... --trust_host_key
Expected behavior
The CLI should create
~/.ssh/known_hosts
and then proceed to add the host to that file.Please complete the following information):
earthly/dind:ubuntu
)The text was updated successfully, but these errors were encountered: