How to configure MikroTik for a small business: a secure baseline step by step
Update RouterOS, replace the admin user, close management services, set up the firewall and a guest network — with ready-to-use commands.
Read articleFast, encrypted, deduplicated backups to a NAS or cloud storage, with automatic retention and a restore test.
restic is a free, open-source backup tool that encrypts everything before it leaves the server, stores only changed data and can send backups to a NAS over SFTP, to S3-compatible object storage and other destinations. It is a good fit for web, file and application servers.
backup on a NAS at 192.168.88.20 with SSH key login. Store the repository password safely outside the server (for example in your password manager): without it, the backups cannot be restored. For database servers, dump the database to a file before the backup (for example with pg_dump or mysqldump).Generate a random password, save a copy in your password manager and initialise the encrypted repository.
sudo apt install restic
sudo sh -c 'openssl rand -base64 32 > /root/.restic-pass && chmod 600 /root/.restic-pass'
export RESTIC_PASSWORD_FILE=/root/.restic-pass
export RESTIC_REPOSITORY=sftp:backup@192.168.88.20:/volume1/restic/web01
restic initBack up configuration, website files and home directories. Adjust the paths to what matters on your server.
restic backup /etc /var/www /home --exclude-caches
restic snapshotsKeep 7 daily, 4 weekly and 6 monthly snapshots and remove older ones. restic check verifies that the repository is consistent.
restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --prune
restic checkCreate a script and run it every night with cron. Add monitoring so you are alerted when the backup fails or the log stops updating.
#!/bin/sh
# /usr/local/bin/backup.sh
export RESTIC_PASSWORD_FILE=/root/.restic-pass
export RESTIC_REPOSITORY=sftp:backup@192.168.88.20:/volume1/restic/web01
restic backup /etc /var/www /home --exclude-caches || exit 1
restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --prune
# /etc/cron.d/backup
30 2 * * * root /usr/local/bin/backup.sh >> /var/log/backup.log 2>&1A backup is only proven by a restore. Restore the latest snapshot to a test folder at least once a month and open a few files.
restic restore latest --target /tmp/restore-test
ls /tmp/restore-testThe best backup tool is the one that runs every night and has been restored at least once.
Need help with this? Contact CySec for a free consultation.
Update RouterOS, replace the admin user, close management services, set up the firewall and a guest network — with ready-to-use commands.
Read articleGive staff secure access to office files and 1C from home — without opening RDP or Winbox to the internet.
Read articleA practical checklist with commands: personal admin account, SSH keys, firewall, automatic security updates and fail2ban.
Read articleOur engineers can review your current setup and propose concrete improvements.