Skip to content

Instantly share code, notes, and snippets.

@jbourassa
Created September 17, 2012 14:23
Show Gist options
  • Save jbourassa/3737627 to your computer and use it in GitHub Desktop.
Save jbourassa/3737627 to your computer and use it in GitHub Desktop.
Replace your public key for all users
for f in /home/*
do
if [ -f "$f/.ssh/authorized_keys" ]
then
sudo sed -i "s|OLD_KEY|NEW_KEY|g;" "$f/.ssh/authorized_keys"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment