Automate SSH Key Rotation on Ubuntu with Ansible

Overview Changing your SSH keys is as important as changing your underpants daily, running this script on a frequent basis will ensure access to the servers are changed on a regular basis. Use Ansible to do ssh key rotation in your sleep! Test Bed Ansible control server running Ubuntu 18.04 LTS Test server running Ubuntu… Read more »

Limit SSH connections geographically

There is a real security risk to leaving your shell connection ports exposed to the internet especially if you don’t ever intend on connecting from Zimbabwe as well as other random countries. This can limit brute force attack exposure and also save valuable resources and bandwidth by rejecting a packets before a tcp handshake. Install… Read more »

Adding Colour to Linux Bash Shell

If the standard black and grey makes you feel uninspired, you can change this by adding two lines to your .bashrc file in the users profile. 1. Edit the .bashrc file

2. Add the following lines

Should you have any questions, comments or suggestions, please don’t hesitate to comment below. If you like… Read more »

Setup SSH Keys for Linux Key Based Authentication

Generating RSA Keys 1. Create a folder called “.ssh” under the root folder (change ~ for the full path of the user if you are using a user account)

2. Change permissions on the “.ssh” folder to 700

3. Generate keys

You will be prompted for a location to save the keys… Read more »

Stop SSH from Listening on IPv6

By default, SSH listens on both IPv4 and IPv6, if you don’t connect using IPv6 then you can disable it entirely from listening. Example:

Edit your SSH config file /etc/ssh/sshd_config

Uncomment out the following line:

Restart SSH daemon

Rerun netstat to check it isn’t listening

Should you have any questions,… Read more »