Created
November 25, 2016 16:54
-
-
Save pixelbrackets/d1dfb430b9fcafa28cb5e2715665f85a to your computer and use it in GitHub Desktop.
Remove ssh key form authorized_key files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /home/ | |
### you may search for a part of the public key only, but make sure to not match unwanted keys of other users | |
grep -R -l 'SomeSSHKeyOrHostname' */.ssh/authorized_keys | |
sed -i '/SomeSSHKeyOrHostname/d' somedeploymentuser1/.ssh/authorized_keys | |
sed -i '/SomeSSHKeyOrHostname/d' somedeploymentuser2/.ssh/authorized_keys | |
sed -i '/SomeSSHKeyOrHostname/d' somedeploymentuser3/.ssh/authorized_keys |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment