Clemens Schwaighofer 65a235b152 Add -g (go) option, add force new key creation, test script add
Remove and Rotate script have -g (go) flag for actual run.
Remove has text updates for removed key info
Rotate force only forces rotation, but will not create new key unless -c (force create) is set
Test script added for testing connections
2024-05-16 13:55:18 +09:00

Rotate all ssh keys on servers for certain users

  • create new key with name scheme
  • copy to server to
    • $ADMIN/.ssh (to be ended for admin user)
    • /etc/ssh/authorized_keys--master
    • /etc/ssh/authorized_keys/$USER

Then remove old key

Store ssh key name for current period

Scripts

rotate-ssh-keys.sh

Will create a new key and deploy on the server and move the PEM part to the local SSH folder

remove-old-ssh-keys.sh

Will check in the previous ssh public key folder and remove this entry from the remote server

Options

  • -h override single host name
  • -u override user name for a host
  • -f force key change
  • -n dry run
Description
No description provided
Readme 104 KiB
Languages
Shell 100%