How do I set up a Windows SSH server with keys in order to backup my Smoothwall configuration?
Article #: |
Product |
Castle |
---|---|---|
1075 |
|
|
Summary
The scheduler found in System > Maintenance > Scheduler can be used to setup a weekly push of a backup archive to a third party SSH server. However, when using a Windows server as the third party backup destination, the free application WinSCP is an easier option to use for pulling a weekly backup from the Smoothwall.
Problem
How do I set up a Windows SSH server with keys in order to backup my Smoothwall configuration?
To do this you will need WinSCP installed from http://winscp.net/eng/download.php.
Note: WinSCP is a third party piece of software which allows file transfer over the SSH Protocol.
Solution
1. | Download and install WinSCP to the required server. |
2. | Create a batch file containing the following information: |
@echo off
set RootPW="password"
set Host="Smoothwall_IP"
set LocalDir="directory_path"
set RemoteDir="/var/archive"
"c:\Program Files\WinSCP\WinSCP.exe" /console /command "open scp://root:%RootPW%@%Host%:222" "synchronize local -criteria=either %LocalDir% %RemoteDir%" "exit"
where:
• | password is the root password of the Smoothwall |
• | Smoothwall_IP is the Smoothwall's internal IP address the Windows server connect to |
• | directory_path is the full path of the local directory on the Windows server where the backups should be copied to, for example, c:\backup\swbackup\ |
• | Leave RemoteDir as /var/archive as this is the path to the directory on the Smoothwall where the backups are stored |
3. | Save the file with a .bat file extension. |
4. | On the Smoothwall, create a backup archive of all system settings. Ensure the automatic backup option is enabled. See https://help.smoothwall.net/Latest/Content/cgi-bin/admin/backup.htm |
5. | On the Smoothwall, create a schedule to prune the archives — see https://help.smoothwall.net/Latest/Content/cgi-bin/admin/autoupdate.htm |
This will instruct the Smoothwall to make a backup on a weekly basis on the day and hour set, as well as create a backup archive when the system is rebooted. The pruning will insure that only the latest backup archives are retained.
6. | Finally, use Task Scheduler on the Windows server to run the backup script on the same day the Smoothwall automatic backup is taken BUT at an hour later. |
Attribution:
Last updated: |
Author: |
Contributions by: |
---|---|---|
23 August 2016 |
|
DMT |