During a pentest, you come across an SSH private key (id_rsa) in a user’s home directory and suspect that this key can be used to remotely log in to other Linux hosts. However, before you try to use the key, you want to compare the key to the contents of the authorize_keys file to ensure it matches one of the public keys stored in the file. Which command would you run to generate a public key from the private key?

🎲 Try a Random Question  |  Total Questions in Quiz: 7  |  🧠 Study this quiz with Flashcards
This question is part of a full practice quiz:
CompTIA PenTest+ Certification Exam: Post-Exploitation — practice the complete quiz, review flashcards, or try a random question.


During a pentest, you come across an SSH private key (id_rsa) in a user’s home directory and suspect that this key can be used to remotely log in to other Linux hosts. However, before you try to use the key, you want to compare the key to the contents of the authorize_keys file to ensure it matches one of the public keys stored in the file. Which command would you run to generate a public key from the private key?