Pi-hole LXC with gravity-sync?

I am running into one issue and that is it keeps asking for a password for the user gravity.
I looked around and quite some people have issues like this, but I have no idea what the exact config settings are that are required.
You should only need to provide that password once when doing the initial configuration of gravity-sync. After that gravity-sync should install public private keys and then those should be used instead of password authentification.

Did you set up sudo so gravity-sync is allowed to get root privileges?
 
Last edited:
You should only need to provide that password once when doing the initial configuration of gravity-sync. After that gravity-sync should install public private keys and then those should be used instead of password authentification.

You have set up sudo so gravity-sync is allowed to get root privileges?
I got it working!

I created a new ssh keypair with ed25519 and copied those with ssh-copy-id and then it worked, I would guess the default ssh-rsa isn't supported anymore?
 
Some old unsecure algorithms got banned from sshd on Debian 12 that were working fine on Debian 11 before.
But for the ssh connection to sync the piholes you shouldn't need to roll out your own keys. The gravity-sync setup should create and rollout my new key pair and that was working fine here with the Debian 12 LXC.

The problem I initially ran into was that the gravity-sync setup wasn't asking for a password in the first place, because the first thing I do when setting up a new LXC is to roll out my ed25519 keys and forbid sshd to use password authentification. Thats why I did that in the tutorial only after setting up gravity-sync. So the order you follow the tutorial is important here.

So for gravity-sync to be able to roll out its own keys you need those LXCs ssh server to either allow password authentification or set up your own public private keys first for that gravity user.
 
Logging in with username/password worked perfectly and I didn’t make any of your suggested changes.
I tried both Debian 11 and 12 as OS.

I installed through tteck helper scripts and added the gravity user right after, did the sudo change, logged in through username/password and installed gravity-sync.
It kept asking for a password, after some searching and troubleshooting I tried my own keys and that worked right away.

I used gravity-sync a few years ago on physical RPi’s and that worked well, so when switching from k3s to proxmox I wanted to use it again.

Thanks for the writeup, apart from this ssh key issue, it was nice to have a guide :)
 
  • Like
Reactions: Dunuin
Then its maybe related to how tteck's scripts set up that LXC? I created those LXCs via webUI.
 
Hey thanks for the detailed installation guide, it helped me a lot!

I am running into one issue and that is it keeps asking for a password for the user gravity.
I looked around and quite some people have issues like this, but I have no idea what the exact config settings are that are required.

I tried debian 11 and 12, but seem to have the same issue, I tried diagnosing with ssh -vvv, but it seems it doesn't pickup the keys.
Hi,

I solved this by running this command before running gravity-sync auto from "<BackupIP>" LXC:

ssh-copy-id -i /etc/gravity-sync/gravity-sync.rsa.pub “<MasterIP>”

and "<MasterIP>" LXC:

ssh-copy-id -i /etc/gravity-sync/gravity-sync.rsa.pub “<BackupIP>”
 
Last edited:
  • Like
Reactions: Dunuin
Hi,

I solved this by running this command before running gravity-sync auto from "<BackupIP>" LXC:

ssh-copy-id -i /etc/gravity-sync/gravity-sync.rsa.pub “<MasterIP>”

and "<MasterIP>" LXC:

ssh-copy-id -i /etc/gravity-sync/gravity-sync.rsa.pub “<BackupIP>”
Thanks. I've added your post to the tutorial.
 
I've been putting off this project for a while now. I finally ran across your guide, which happened to be the most complete and detailed guide I could find.

I was able to get everything setup in about 20 minutes! Everything works as expected. Thank you SOOOO much for not only taking the time to document your process, but also sharing it with the community. It is people like you that make this community so special!
 
  • Like
Reactions: Dunuin and theetjuh
It looks like Gravity Sync has been retired as of July and won't get any further updates nor work with Pi-Hole v6.

Is there any other alternative?
 
Thanks for the hint. I will see If I will write a new tutorial once I find some time to update my Piholes to v6.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!