3 ms·
> So now when using plain git the choices are to have every action tracked, or to go through a very annoying process involving randomly generated keys. EDIT: t
by lewiscollard 5y ago
> So now when using plain git the choices are to have every action tracked, or to go through a very annoying process involving randomly generated keys.
EDIT: this alias has a bug that means it doesn't work as intended, see below, don't use it
If you're that worried, I threw this shitty Bash function together in five minutes just now; stick this in your bashrc and then `anongit ...` instead of `git`:
anongit () {
mkdir -p ~/.random-ssh-keys
KEYNAME=$(openssl rand -hex 12)
KEYFILE=~/.random-ssh-keys/$KEYNAME
ssh-keygen -q -C $KEYNAME -N "" -f $KEYFILE
GIT_SSH_COMMAND="ssh -i $KEYFILE" git "$@"
}
Problem solved!
...or you could clone over HTTPS instead :)
- judge2020 5y agoGitHub doesn't just need any SSH key, it needs an SSH key attached to an account, probably for abuse/DoS prevention purposes.
- lewiscollard 5y agoShit, you're probably right. It only worked because I didn't tell SSH to only use the specified identity files (I threw it together in five minutes without really testing it, you can forgive me). Changing one of the lines to this (which it should have been all along): GIT_SSH_COMMAND="ssh -i $KEYFILE -o IdentitiesOnly=yes" git "$@" ...comes up with "Permission denied (publickey)". So, yep, you're 100% right. Oh well. There's still HTTPS!