[SOLVED] How to auto download backup file from pfsense to local folder via SCP?
-
There should be no need to run this in a script. Just get it working from the command line first.
It looks like your goal here is to run it from pfSense to push the backup to some other box using a cronjob, yes?
So I'm not sure why you are trying to connect to 192.168.13.10, isn't that where you are running this?
-
@stephenw10 said in How to auto download backup file from pfsense to local folder via SCP?:
oks like your goal here is to run
Yes it is just to push backup and ideally to use a cronjob to do so.
However for now, I am tasked to try to push the backup from pfsense to my own pc first....which i created a folder to store it.
Regarding the connecting to 192.168.13.10 (my ethernet ip) , I am not too sure how to write scp command, that is what i read from other forum. I hv tried multiple combination. And i was wondering how would pfsense know where C:/users/.. are located if i did not specify which ip it is on, better yet which host...smtg like the adress location if u get what i meant
Again, i just want the backup to push into my local pc. my pfsense is running on a virtual box, my pc is not.
ssh config and sshd config are all listening to port 22
Edit: I could ping, putty, winscp, telnet from my pc to pfsense. However, at my pfsense test port, i typed my hostname (pc ip) and port 22. it says connection fail.
-
Do you have an SSH server running on your local machine? Windows does not run SSH by default.
The very first part of this is to be able to SSH from the pfSense command line to where ever you plan to sent the config files.
If you can do that using a password login then move to using SSH key login instead. Then try using scp.
Steve
-
@stephenw10 okay so you meant that i hv to install OpenSSH and enabled the ssh? Then it should be working?
So i just need to type the following cmd on pfsense?
scp - r root@fwip:/cf/conf/backup user@localip:C:\path\to\store\bckupOr
scp - r /cf/conf/backup user@localip:C:\path\to\store\bckup
-
Thank you everyone for assisting
I wrote another script on powershell which works for me, will post when it is fully functional with other additional features.