Key-based authentication uses a pair of cryptographic keys (a private key and a public key) to securely log into a remote server without typing a password.
Click to reveal answer
beginner
What command generates an SSH key pair?
The command ssh-keygen creates a new SSH key pair (private and public keys) on your local machine.
Click to reveal answer
beginner
Where should the public key be placed on the remote server for key-based authentication?
The public key should be added to the ~/.ssh/authorized_keys file in the user's home directory on the remote server.
Click to reveal answer
beginner
Why is it important to keep the private key secure?
The private key is like a secret password. If someone else gets it, they can access your servers without permission. So, it must be kept private and protected.
Click to reveal answer
intermediate
How does key-based authentication improve security compared to password authentication?
It avoids sending passwords over the network, uses strong cryptography, and can be combined with passphrases for extra protection, making it harder for attackers to gain access.
Click to reveal answer
Which file on the remote server stores the public keys allowed for SSH login?
A~/.ssh/authorized_keys
B~/.ssh/id_rsa
C~/.ssh/config
D~/.ssh/known_hosts
✗ Incorrect
The authorized_keys file contains the public keys that the server accepts for login.
What command do you use to create a new SSH key pair?
Assh-copy-id
Bssh-keygen
Cssh-add
Dssh-agent
✗ Incorrect
ssh-keygen generates a new SSH key pair.
Which key must you keep secret to maintain security in key-based authentication?
APublic key
BAuthorized key
CPrivate key
DHost key
✗ Incorrect
The private key must be kept secret because it grants access to your account.
What is the main benefit of using key-based authentication over password authentication?
AIt disables SSH login
BIt uses weaker encryption
CIt requires less disk space
DNo need to type a password each time
✗ Incorrect
Key-based authentication allows logging in without typing a password, improving convenience and security.
Which command copies your public key to a remote server for easy setup?
Assh-copy-id
Bscp
Cssh-add
Dssh-keygen
✗ Incorrect
ssh-copy-id copies your public key to the remote server's authorized_keys file.
Explain the steps to set up key-based authentication for SSH login.
Think about creating keys, placing the public key on the server, and connecting.
You got /4 concepts.
Why is key-based authentication considered more secure than password authentication?
Consider what happens when you use keys instead of typing passwords.
You got /4 concepts.
Practice
(1/5)
1. What is the main purpose of key-based authentication in SSH?
easy
A. To encrypt files on the local computer
B. To allow secure login without typing a password every time
C. To speed up the internet connection
D. To create a backup of the server data
Solution
Step 1: Understand key-based authentication
Key-based authentication uses a pair of keys to allow login without passwords.
Step 2: Identify the main benefit
This method lets users connect securely without typing passwords each time.
Final Answer:
To allow secure login without typing a password every time -> Option B