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.

link|improve this question
possible duplicate of Centralized management system for SSH keys? – quanta Oct 21 '11 at 5:50
feedback

migrated from stackoverflow.com Oct 21 '11 at 4:32

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

1 Answer

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

#!/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.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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