Automate Updating SSH Keysby J. Edward Durrett
Regularly changing ssh keys is a good practice that often gets pushed to
To use the above script, change the variables at the top for your setup.
If you already have keys set up, it will run, create a new key, and put
the public key on the remote machine.
When used on a regular basis, it will create a new key pair, put the
public key on a remote machine and also delete the old public key from
the remote server.
It can be put in a crontab to run on a regular basis, or can be called
from another script whenever that script is run. For example,
integrated with a backup script it will change the keys every time the
backup is run.
For users, it can be put in their crontab and they will always have new
keys without even having to bother with thinking about it.
Copyright (c) 2019, Jason Edward Durrett - All content on this site, unless otherwise noted, is subject to this license.
Please contact me if any errors, such as erroneous / misleading content or missing / incomplete attribution, are found.