vmstan / gravity-sync

๐Ÿ’ซ The easy way to synchronize the DNS configuration of two Pi-hole 5.x instances.
https://vmstan.com/gravity-sync/
GNU General Public License v3.0
2.24k stars 118 forks source link

password repeat issues in LXC #451

Open z1haze opened 3 weeks ago

z1haze commented 3 weeks ago

Issue Description I have my pihole servers install as lxc's (i used proxmox-helper-scripts) which install it using a "automatic login" to the shell. That said, I did go into sshd_config and enable root login and I set a password for the root accounts on both machines. (this is all on a private network, so no risk, please don't lecture). Anyway, after doing so I installed your integration on both containers, provided the password and it generated the ssh keys, etc. I make some changes on instance on and kicked off a dry-run to see how it would work, and it asked me for my password on literally every step before it would move on to the next step. I'm not sure if this is a setup issue, or an issue with the lxc, but I would not expect to have to enter the password a dozen times for this to function. The command I ran was gravity-sync compare Below is the full output, but after each and every line printed, it required me to re-enter the password.

root@pihole:~/.ssh# gravity-sync compare
โˆž Initializing Gravity Sync (4.0.7)
โœ“ Loading gravity-sync.conf
โœ“ Detecting local Pi-hole installation
root@10.0.1.3's password:  installation
โœ“ Detecting remote Pi-hole installation
root@10.0.1.3's password: 
โœ“ Gravity Sync remote peer is configured
โœ“ Evaluating arguments: COMPARE
ยป Remote target root@10.0.1.3
โœ“ Validating pathways to Pi-hole
โœ“ Validating pathways to DNSMASQ
root@10.0.1.3's password: ty Database
โœ“ Hashing the remote Gravity Database
โœ“ Comparing to the local Gravity Database
! Differences detected in the Gravity Database
root@10.0.1.3's password: 
root@10.0.1.3's password: ecords
โœ“ Hashing the remote DNS Records
โœ“ Comparing to the local DNS Records
! Differences detected in the DNS Records
root@10.0.1.3's password: 
! DNS CNAMEs not detected on the local Pi-hole
root@10.0.1.3's password: 
! Static DHCP Addresses not detected on the local Pi-hole
! Replication of Pi-hole settings is required
โˆž Gravity Sync COMPARE completed after 15 seconds
root@pihole:~/.ssh#
z1haze commented 3 weeks ago

whoops this looks like a duplicate of #418 and #442 ... perhaps update your documentation this seems to be a common issue

z1haze commented 3 weeks ago

Can confirm that adding the lxc user to the sudoers file fixes the issue, however it did require that i reinstall gravity-sync to make it work. e.g. usermod -aG sudo root (in my case)

The documentation for install mentions it will setup a passwordless sudo something or-other during the installation but appears it doesn't work.