1

Possible Duplicate:
Centralized management system for SSH keys?

I have multiple boxes and multiple employees. Is there a program or script that allows an admin to easily add or remove ssh keys? If an employee joins or leaves my company, it would be nice to run a command to allow or revoke their ssh key across multiple boxes.

mac2017
  • 13
  • 3

1 Answers1

0

I think it'd be easier and you'd have better luck finding a solution that removes the users from the user list, vs trying to remove ssh keys.

By removing the user, you're revoking that user's access to the machine. Are you in a situation where this isn't possible? If not, a script like the following can be used to easily remove users from all of your machines

#!/bin/bash
ssh -t user@host 'sudo userdel -r badusername'
ssh -t user@host2 'sudo userdel -r badusername'

The -r in userdel will remove the user's home directory, which means the key will be removed as well.

earthmeLon
  • 175
  • 5