FreePBX SSH Storage Location fails while CLI SSH works

Hi Guys,

Once upon a time Ioved FreePBX. It worked straight out of the ISO. Alas, I am not so enamoured now. Can anyone help me get the SSH Storage location working so I can back up please? SSH functions flawlessly from the command line but not for running back-ups from the FreePBX GUI.

PBX Version:
PBX Distro:12.7.8-2203-1.sng7
Asterisk Version:16.24.0

Host Side
Connection from port 55178 on port 1964 rdomain “”
Aug 17 01:59:52 hostname sshd[196332]: Received disconnect from port 55178:11: [preauth]

FreePBX Side
Saving to selected Filestore locations
Saving to: SSH:‘hostname’ instance ,File location: /bu/pbx/DailyBackup/20220817-025954-1660701594-
Finished Saving to selected Filestore locations
There were errors during the backup process
Could not login with username: username, host: hostnamefqdn
Generated Backup process result email to [email protected]. Status: Failure

FreePBXing is becoming tiresome otherwise.

are your asterisk user certificates current and authorized on the remote ssh server?

Thank you for the response Dicko. I have to admit, I am at a loss User Certificates??? what the h…? I’m certain that if FreePBX is using the Linux SSH, this should work regardless of certificates in the GUI. SSH has it’s own independant system of encryption, IDs & Keys that do not rely on certificates. I have several servers, none of them have relied on a certificate to regulate access or encrypt data. SSH-ing in to the same server from various other servers using what I would assume to be the same command used, though different file, to transfer the relevant data from client to the host is not dependent on the cert being valid or not. And, SSH-ing from the CLI using ID’s generated at CLI works flawlessly. That functionality is somehow being interfered with through the GUI.

backup/restore global setting. consider the public and private key pair a ‘certification’

I think you mean a root shell when you speak of the CLI, FreeaPBX including its backup procedure does not run as root but as the asterisk user

Confirm that while running as the asterisk user, you can ssh to the target host without typing a password.

If not, fix that first and retest.

Ah very good that’s helpful thank you. I have to be running as the asterisk user. That might help. Where do I get the asterisk user password so I can log on as the asterisk user?

Then of course there is this statement also on the community forum.
" The ‘asterisk’ user doesn’t have a password by default , but, you should be using root to do your backups, not asterisk"

Thanks Dicko but what key pair?

I only have the public key. And yes I do mean root shell. If the backup process runs as the asterisk user, why can I not get access to the asterisk user shell using putty?

You don’t.

If you are using the Backup & Restore and Filestore Modules, then you are using root to access the asterisk user. But that is not relevant. When you use the Filestore module to create an SSH destination, you can specify all the things. It is very clear. This location is the private key associated with the asterisk user.

You can grab the public key to put on your remote system in the B&R Module.

Obviously, the user in the Filestore module will not be root if that is not the user on the destination server. That screenshot is from a warm spare config using the default settings.

Or you can directly copy it to your destination server from the FreePBX CLI.

SUCCESS Thank you Sorvani, To be honest I had changed to two entries by generating one ID for root, exporting that ID’s public key and managing to get SSH logging on from root user shell with no password already. The problem was the back-up still failed regardless of the host having the correct public key for root and the correct private key being specified in the config. However. taking your advice and copying the asterisk public key onto the host using sudo, took me a little further. I was still faced with a failure but this time it said something about an incorrect root. I went back to the config and spelled out exactly what folder the backup should be placed into all the way from the root eg:/home/username/bu/pbx instead of specifying it from the users foler as /bu/pbx. That allowed the back-up to complete sucessfully.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.