I’m trying to setup weekly backup to my SSH backup location (a local box on my LAN) but I’m coming unstuck because I can’t setup passwordless ssh login between my FreePBX box (run under the root user) and my SSH backup location (not using root).
I don’t know if normal FreePBX uses ‘root’ or just rasPBX
Are you using the Backup and Restore module for the backup? If so, you specify the ssh username and key for the remote server in the backup destination. The local FreePBX user accounts are irrelevant.
Thanks. I’ll give that another try and see if I have better success.
I don’t know whether to post this as a separate question or not: I’ve been so impressed with FreePBX/RasPBX I am going to get my parents a Pi and their own PBX and link the two with IAX and ZeroTier. Can you advise if it’s feasible to ‘image’ or clone the SD card and reuse it on theirs? Obviously I’ll have to delete the extensions and change settings for the trunks but it would potentially save me hours and hours of upgrading and installing modules and also all the little fiddly packages I’ve installed onto the base OS would already be there.
The easiest way to do this is to remove the sd card from your RPi (after sanely turning the RPi off) , mount it on any machine that has dd available, that is any linux or apple box and any windoze box that has “linux” extensions cygwin or lately WSL (windo$e subsytem for linux) , then
dd if=/dev/'yoursdcardname' of=RPi.image
this will write a file called RPi.image to your current working directory. You can then put the sd card back in your Pi(hole) and when needed, mount any other larger sd card on that machine and
dd if=RPi.image of=/dev/'yournewsdcardname'
That can be used in either your parents pi or your own pi when its current sd card get corrupted, which WILL happen sooner or later.
You can identify the sdcard’s real /dev/‘name’ with
Thanks very much, Dicko! Closer inspection of the RasPBX homepage shows they also have a tool (which I guess is just ‘dd’ packaged and dolled up??) raspbx-backup
Still no joy. Am I doing something wrong?
I went onto the FreePBX box and did:
ssh-keygen -t rsa
it stored the file as:
Your public key has been saved in /root/.ssh/id_rsa.pub
I then did
cat /root/.ssh/id_rsa.pub | ssh [email protected] 'cat >> .ssh/authorized_keys
where [email protected] is the user on the remote server
Then logged in to the remote server from the Freepbx SSH command line, and after accepting the fingerprint, I was given access to the remote server without need of a password.
When I specify in the freepbx GUI that /root/.ssh/id_rsa.pub is the key to use, I get
Warning: Identity file /root/.ssh/id_rsa.pub not accessible: Permission denied.
Probably something stupid I’m doing.
Asterisk indeed cannot access files in /root/ you should generate separate keys for the asterisk user and install them in the asterisk users home folder
This wiki page shows how to generate ssh keys as the Asterisk user:
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.