Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

migrated from Oct 21 '11 at 4:32

This question came from our site for professional and enthusiast programmers.

marked as duplicate by quanta, voretaq7 Jul 27 '12 at 19:21

This question was marked as an exact duplicate of an existing question.

up vote 0 down vote accepted

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

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.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.