Skip to content
This repository was archived by the owner on Jul 26, 2024. It is now read-only.

Failed to validate connection #34

Closed
wderuijter opened this issue Jun 3, 2020 · 9 comments · Fixed by #36
Closed

Failed to validate connection #34

wderuijter opened this issue Jun 3, 2020 · 9 comments · Fixed by #36
Assignees
Labels
bug Something isn't working

Comments

@wderuijter
Copy link

wderuijter commented Jun 3, 2020

Describe the Issue
When running ./gravity-sync.sh config on the secondary pi hole installation I get past the SSH user/pass for the primary pi hole when I get the output:

[ INFO ] Using SSH Key-Pair Authentication
[ FAIL ] Validating Connection to 192.168.1.2

When running ssh 'username@ip' i can connect to the primary pi hole through SSH.

Configuration:

  • OS for Primary/Secondary: Both running Raspbian GNU/Linux 9 (stretch)
  • Platform for Primary/Secondary: both Raspberry Pi 3B+'s.
  • SSH Server/Client: OpenSSH_7.4p1
  • SSH Authentication: Key-Pair
  • Gravity Sync Version: 1.7.7
  • Pi-hole Versions: v5.0
@vmstan
Copy link
Owner

vmstan commented Jun 3, 2020

Did you generate an SSH key in the config script, or did you have one created already? When you manually connect does it ask for a passphrase?

@vmstan vmstan added the bug Something isn't working label Jun 3, 2020
@wderuijter
Copy link
Author

wderuijter commented Jun 3, 2020

Did you generate an SSH key in the config script, or did you have one created already? When you manually connect does it ask for a passphrase?

@vmstan I've created the key in the config script. I see the key in the secondary pi's /home/admin/.ssh
I see the authorized_keys file on the primary pi is modified at the same.
edit: When I manually connect through SSH to the primary pi hole does not ask for a keyphrase but for the users password.

When I manually connect through SSH to the primary pi hole it does ask for the keyphrase and I can connect.
I'm quite the linux newbie so I might be doing something stupid here.

@vmstan
Copy link
Owner

vmstan commented Jun 3, 2020

Can you screenshot the command you're using for the manual connection and what the authentication prompt looks like? Are you you specifying to use the keyfile? ssh -i ~/.ssh/id_rsa user@host

Just saw your update about the passphrase. You will need to regenerate the keyfile without a passphrase. Delete the ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub files and then rerun the ./gravity-sync config command to generate a new one and leave the passphrase fields blank when prompted.

@wderuijter
Copy link
Author

Great success @vmstan. Thanks :-)

@vmstan
Copy link
Owner

vmstan commented Jun 3, 2020

Great! 1.8 which was just published already has rewrites to the config portion with the goal of bypassing the prompts that were confusing about adding a passphrase to begin with. That portion should be automatic now, you'll just have to authenticate the one time to the primary when you copy your keyfile over. Hopefully to prevent this issue in the future.🤞

@vmstan vmstan linked a pull request Jun 3, 2020 that will close this issue
@vmstan vmstan self-assigned this Jun 3, 2020
@wderuijter
Copy link
Author

Just pulled the update in. Great clarification of the steps. Thanks @vmstan, this script makes my life even simpler ;-)

@wderuijter
Copy link
Author

Although I'm running into an issue reconfiguring 1.8:
<ity-sync$ sudo ./gravity-sync.sh config [ INFO ] Gravity Sync 1.8.0 Executing [ OK ] Evaluating Arguments: CONFIGURE Requested [ WARN ] No Active gravity-sync.conf [ OK ] Validating SSH Client on raspberrypi (OpenSSH)[ OK ] Validating RSYNC Installed on raspberrypi [ EXEC ] Creating gravity-sync.conf from Templatecp: cannot stat '/root/gravity-sync/gravity-sync.conf.example': No such file or directory [ FAIL ] Creating gravity-sync.conf from Template pi@raspberrypi:/home/admin/gravity-sync$

@vmstan vmstan reopened this Jun 3, 2020
@vmstan
Copy link
Owner

vmstan commented Jun 3, 2020

Don't run the script with sudo it'll break all kinds of things. It elevates itself inside the script where it needs to. Otherwise it'll do things like look in the wrong home directories or use the root user SSH keys.

@vmstan vmstan closed this as completed Jun 3, 2020
@vmstan
Copy link
Owner

vmstan commented Jun 3, 2020

1.8.1 now will detect this.

@wderuijter wderuijter changed the title Failed to validatie connection Failed to validate connection Jun 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants