Skip to content

Instantly share code, notes, and snippets.

@rikvanderkemp
rikvanderkemp / ssh-known-hosts-mgmt.sh
Created February 25, 2021 11:37 — forked from ctnpull/ssh-known-hosts-mgmt.sh
SSH known_hosts tools
# This is a short collection of tools that are useful for managing your
# known_hosts file. In this case, I'm using the '-f' flag to specify the
# global known_hosts file because I'll be adding many deploy users on this
# system. Simply omit the -f flag to operate on ~/.ssh/known_hosts
# Add entry for host
ssh-keyscan -H github.com > /etc/ssh/ssh_known_hosts
# Scan known hosts
ssh-keygen -f /etc/ssh/ssh_known_hosts -H -F github.com
@rikvanderkemp
rikvanderkemp / gist:d91b2fa03d87f9ad18ae6d8753799342
Created June 20, 2018 08:42 — forked from carlosmcevilly/gist:2221249
fix git commit with wrong email address in git config, before pushing
If:
- you add and commit with the wrong email address in git, and
- your remote has a hook set up to prevent you from pushing with the bad address
Then you need to amend the author of your commit before push can succeed:
1. fix your email address in git config:
$ git config user.name "Your Name"