So you probably use ssh-keygen
in GitBash. When you used this command, it asked for file where the key should be stored in. By default this is ~/.ssh/id_rsa
. You need to delete the specified file (as defined while creating the key) and the associated public key (e.g. id_rsa.pub
).
You can inspect the content of the 3 files you have in ~/.ssh
with cat ~/.ssh/xyz
:
- If you see something like
-----BEGIN RSA PRIVATE KEY-----
, it is a private key.
- If you see something like
ssh-rsa ...
, it is a public key.
Be careful not to delete something you might still need in the future.
Don't worry too much in case you cannot find the key anymore. Just generate a new key-pair and then update the public key in the places where you had it configured. According to your question you just started to use the old key today, therefore you should still know where this is required.
ls ~/.ssh/
?ls ~/.ssh/
are the files in the folder I just mentioned @Matt