SSH Practice Exam Questions
Exam questions and answers explained for the following topics:
- Standard SSH Authentication
- What Is SSH Key-Based Authentication?
- Implementation Steps Implementing key-based authentication
- Generate a Key Pair
- A public/private key pair is a mathematically related set of keys that can uniquely identify a user or computer
- Copy Public Key
- The ssh-copy-id command copies the user's public key to the remote server
- Enforce Key-Based Authentication
- Key-based authentication for SSH certainly improves your organization's security posture. To enforce this method, update the /etc/ssh/sshd_config file on the remote servers to require key-based authentication and refuse password-based connection attempts.
https://www.comptia.org/blog/3-steps-to-implement-ssh-key-based-authentication
Which of the following is a standard SSH authentication method?
a) PAM
b) LDAP
c) Kerberos
d) Password
Explaination:Answer: d) Password
What is SSH key-based authentication?
a) A method of authentication that uses a username and password
b) A method of authentication that uses a public/private key pair
c) A method of authentication that uses biometrics
d) A method of authentication that uses a security token
Explanation:Answer: b) A method of authentication that uses a public/private key pair
What are the implementation steps for implementing key-based authentication?
a) Generate a key pair, copy the public key to the remote server, and configure the remote server to require key-based authentication
b) Install the openssh package, generate a key pair, and configure the local client to use key-based authentication
c) Update the /etc/ssh/sshd_config file on the remote server to require key-based authentication, generate a key pair, and copy the public key to the remote server
d) Update the /etc/ssh/ssh_config file on the local client to use key-based authentication, generate a key pair, and copy the public key to the remote server
Explanation:Answer: a) Generate a key pair, copy the public key to the remote server, and configure the remote server to require key-based authentication
What is a public/private key pair in SSH?
a) A set of keys that can uniquely identify a user or computer
b) A set of keys that can be used to encrypt and decrypt messages
c) A set of keys that can be used for digital signatures
d) A set of keys that can be used to establish secure connections
Explanation:Answer: a) A set of keys that can uniquely identify a user or computer
What does the ssh-copy-id command do?
a) Copies the private key to the remote server
b) Copies the public key to the remote server
c) Copies the public key from the remote server to the local client
d) Copies the private key from the remote server to the local client
Explanation:Answer: b) Copies the public key to the remote server
How can key-based authentication be enforced in SSH?
a) By updating the /etc/ssh/sshd_config file on the remote server to require password-based authentication and refuse key-based authentication attempts
b) By updating the /etc/ssh/sshd_config file on the remote server to require key-based authentication and refuse password-based authentication attempts
c) By updating the /etc/ssh/ssh_config file on the local client to use key-based authentication
d) By updating the /etc/pam.d/sshd file on the remote server to use key-based authentication
Explanation:Answer: b) By updating the /etc/ssh/sshd_config file on the remote server to require key-based authentication and refuse password-based authentication attempts
Which of the following is a disadvantage of key-based authentication in SSH?
a) It is less secure than password-based authentication
b) It requires additional software to be installed on the client and server
c) It can be difficult to manage key pairs for a large number of users or servers
d) It does not work with multi-factor authentication
Explanation:Answer: c) It can be difficult to manage key pairs for a large number of users or servers
Which command can be used to generate an SSH key pair?
a) ssh-keygen
b) ssh-copy-id
c) ssh-add
d) ssh-agent
Explanation:Answer: a) ssh-keygen
What is the default location for the SSH configuration files on a Linux system?
a) /etc/ssh/
b) /usr/bin/ssh/
c) /home/username/.ssh/
d) /var/log/ssh/
Explanation:Answer: a) /etc/ssh/
Which of the following options in the sshd_config file can be used to specify the location of the authorized keys file?
a) AuthorizedKeysFile
b) PubkeyAuthentication
c) PasswordAuthentication
d) ChallengeResponseAuthentication
Explanation:Answer: a) AuthorizedKeysFile
What command can be used to copy a public key to a remote server?
a) ssh-keygen
b) ssh-copy-id
c) scp
d) ssh-agent
Explanation:Answer: b) ssh-copy-id
Which of the following options in the sshd_config file can be used to disable password-based authentication?
a) PubkeyAuthentication
b) PasswordAuthentication
c) ChallengeResponseAuthentication
d) UsePAM
Explanation:Answer: b) PasswordAuthentication
What is the purpose of a passphrase when creating an SSH key pair?
a) To encrypt the private key
b) To authenticate the user
c) To encrypt the public key
d) To encrypt the SSH session
Explanation:Answer: a) To encrypt the private key
Which of the following options in the sshd_config file can be used to specify the allowed authentication methods?
a) AllowedAuthentications
b) AuthenticationMethods
c) AllowedMethods
d) AuthMethods
Explanation:Answer: b) AuthenticationMethods
What is the purpose of the ssh-agent program?
a) To manage SSH key pairs
b) To encrypt SSH traffic
c) To authenticate SSH connections
d) To manage SSH configuration files
Explanation:Answer: a) To manage SSH key pairs