
On Windows, they are located at C:/Users//.ssh folder. So you can easily list all public keys in your system with the following command. On Linux & Mac systems, you will find your public key located at ~/.ssh. They need to be explicitly generated using third party tool like OpenSSH (ssh-keygen) or PuTTYgen. By default, public key pairs are not present in Linux or Windows system. We have assumed that you have indeed generated a key-pair on your system. These keys are used for user authentication whereby your user credentials are encrypted/decrypted using these public-private key pairs. If you encode a message using a person’s public key, they can only decode it using their matching private key. Together, they are used to encrypt and decrypt messages.

Every public key matches to only one private key. In this short article, we will learn how to get your public SSH key files.Ī public key is generally a large alphanumeric string used to encode data, generated by software or provided by trusted third-party authorities. So they are unable to submit their public keys to remote services such as GitHub or even local applications like PuTTY. Many times new developers run tools like ssh-keygen or PuTTYgen to generate public-private key pairs. Public Keys are required to get access to remote servers such as SSH server, or service such as GitHub.
