Linux+ Linux+ Networking Services and Protocols 1 — Questions and Answers
Question 1: Which command generates an SSH key pair on a Linux system?
- ssh-copy-id
- ssh-agent
- ssh-keygen (Correct answer)
- ssh-keyscan
Correct answer: ssh-keygen
ssh-keygen creates RSA, ECDSA, or Ed25519 key pairs used for SSH public-key authentication.
Question 2: Which file on an SSH server is the primary configuration file for the SSH daemon?
- /etc/ssh/known_hosts
- ~/.ssh/authorized_keys
- /etc/ssh/sshd_config (Correct answer)
- /etc/hosts.allow
Correct answer: /etc/ssh/sshd_config
/etc/ssh/sshd_config is the main configuration file for the SSH daemon (sshd) and controls server-side behavior.
Question 3: Which DNS record type maps a hostname to an IPv4 address?
- AAAA
- CNAME
- MX
- A (Correct answer)
Correct answer: A
An A record maps a hostname to an IPv4 address; AAAA records are used for IPv6 addresses.
Question 4: Which command provides the most detailed DNS query output, including response time and authoritative server information?
- host
- nslookup
- dig (Correct answer)
- whois
Correct answer: dig
dig (Domain Information Groper) provides verbose DNS query output including query time, server used, and full answer sections.
Question 5: What TCP port does SSH use by default?
- 21
- 22 (Correct answer)
- 23
- 443
Correct answer: 22
SSH uses TCP port 22 by default for establishing encrypted remote connections.
Question 6: What is the purpose of the /etc/resolv.conf file?
- Store SSH public keys for known hosts
- Define DNS nameserver addresses and search domains (Correct answer)
- Map IP addresses to MAC addresses via ARP
- Configure network interface speed and duplex
Correct answer: Define DNS nameserver addresses and search domains
/etc/resolv.conf specifies the DNS nameserver addresses and search domains the system uses for hostname resolution.
Question 7: Which command copies a local SSH public key to a remote server's authorized_keys file?
- ssh-keygen -c
- scp ~/.ssh/id_rsa.pub user@host:~/.ssh/
- ssh-copy-id user@host (Correct answer)
- ssh-add ~/.ssh/id_rsa.pub
Correct answer: ssh-copy-id user@host
ssh-copy-id appends the local public key to the remote server's ~/.ssh/authorized_keys, enabling key-based authentication.
Which command generates an SSH key pair on a Linux system?