In this article, we will explain how to view your SSH public key on Linux. There are two methods for viewing your SSH public key in Linux-
- The first method is to use the cat command:
- Using the run command.
- Execute the following command.
cat ~/.ssh/id_rsa.pub
The command will display your SSH key on your Linux machine without requiring your key authentication password.
- The second method involves using both the ssh-agent and ssh-add commands::
- Using the ssh-agent command.
- Run the following command.
ssh-agent sh -c 'ssh-add; ssh-add -L'
- After successful authentication, your SSH public key will be displayed in the terminal.
- Copy and paste it where you need it.
In this way, you can view your SSH public key on Linux. For more information on Linux, visit our knowledge base section.