How to find SSH Key
Publisher: Psychz Networks, October 29,2023If you have previously generated an SSH key on your server and wish to locate it, kindly follow the subsequent steps for the retrieval and copying of the SSH public key.
Find and copy the public key:
Once you have generated the SSH Keys, your public key is stored in '.ssh' directory as 'id_rsa.pub' Once you've identified the public key file, you can use various methods to copy its content:
Using the cat command (Linux/macOS):
cat~/.ssh/id_rsa.pub
Using the type command (Windows PowerShell):
type$env:USERPROFILE\.ssh\id_rsa.pub
Using the type command (Windows Command Prompt):
type%USERPROFILE%\.ssh\id_rsa.pub
After running one of the commands above, the content of your public key will be displayed in the terminal. You can then copy the entire content of the public key, including the "ssh-rsa" at the beginning.
IMPORTANT: The SSH key starts with 'ssh-rsa'. Do not forget to copy this part along with the rest of the key.