We’re sharing some example Bash scripts including backups and other methods to simplify the life of a System Administrator.

All HowTo's Ansible & Terraform Automation Cybersecurity Linux Scripting in Bash Ubuntu, Mint & Debian Linux

Use Ansible to Add Users and their SSH public Keys on Multiple Linux Servers

This article demonstrates how to create an Ansible PlayBook that will add users to multiple Linux systems and add their public SSH key allowing them to login securely. Install Ansible on the host that you’ll use to target each of the Linux host you want the new users on. sudo

Read more
All HowTo's Cybersecurity MySQL & MariaDB Scripting in Bash

Dump and Backup all MySQL Databases into their own files

This article demonstrates how to backup all MySQL databases into their own files and then tar the lot including system files. #!/bin/bash TO=”/root” FROM=”/etc /var/www/html /var/backups” DBUSER=”root” DBPASS=’MyPassword’ THISHOST=`hostname` DBLIST=`echo “show databases;” | mysql –password=$DBPASS -u $DBUSER | egrep -v ‘^Database$|^information_schema$|^mysql$’` for DBLOOP in `echo $DBLIST` do mysqldump -u $DBUSER

Read more