🎓 BookMCQ
← Back to 26. Standard Client Server Protocols

📝 SSH protocol in computer networks (9 MCQs)

Secure Shell for Protected Remote Communication

Secure Shell (SSH) is an application protocol suite for secure remote login and other network services over an insecure network. It typically runs over TCP and provides server authentication, confidentiality and integrity. SSH protects interactive terminal sessions, file transfer and tunneled connections, replacing insecure remote-access methods such as traditional TELNET. Its layered design combines identity checks with protection for subsequent application traffic.

Authentication and Encryption in an SSH Session

SSH separates transport protection, user authentication and connection services. The transport protocol negotiates algorithms, performs key exchange and authenticates the server host. The user-authentication protocol verifies the client user, and the connection protocol multiplexes channels for shells, commands, forwarding or subsystems over the protected connection. Separating these responsibilities makes the session easier to reason about and implement.

Key Exchange, Host Verification and User Login

The client connects to the SSH server, exchanges protocol versions and negotiates cryptographic algorithms. Key exchange establishes shared session keys and verifies the server host key. The client then authenticates the user, for example with a password or public key, and requests a shell or another supported service. The ordering ensures that user services begin only after protected transport is established.

Opening an SSH Remote Shell

A technician runs ssh admin@192.0.2.15. The client opens TCP port 22, negotiates a secure transport session and checks the server's host key. The technician authenticates with an authorized public key, then requests an interactive shell. Keystrokes and terminal output travel inside the encrypted SSH channel. This sequence demonstrates both server verification and later authorization of the user.

SSH Services Beyond Interactive Login

SSH can support remote command execution, secure file transfer through SFTP, and port forwarding for carrying other application traffic. Public-key authentication uses a private key held by the client and a corresponding public key authorized by the server. Host-key verification helps the client detect a server identity change or interception attempt.

Misconceptions About SSH Security

'SSH encrypts only passwords' is false because the established session protects subsequent channel data as well. 'A server public host key is the user's login key' confuses host identity with user authentication keys. 'Using port 22 proves the server is genuine' is wrong because the client must verify the host key, not merely the port number.

Identifying SSH Port, Keys and Session Stages

Learn the typical TCP port 22, then separate server host authentication from client user authentication. Trace version exchange, algorithm negotiation, key exchange, user authentication and channel creation. Compare password and public-key authentication, and explain how SSH differs from TELNET in confidentiality, integrity and server identity checking. Trace each stage in order and identify which component provides each security property.

SSH Security and Session Terms

  • SSH - Provides secure remote access and network services.
  • Host key - Authenticates the server to the client.
  • Key exchange - Establishes shared session keys.
  • Public-key authentication - Verifies a user through key possession.
  • Channel - Carries one logical SSH data stream.
  • TCP port 22 - Receives standard SSH connections.
3
Easy
4
Medium
2
Hard

📝 All SSH protocol in computer networks MCQs

Q1. During the SSH handshake, which of the following sequences correctly explains the cause‑effect relationship that leads to the establishment of an encrypted channel?

A.Client sends encrypted data, server decrypts, then key exchange.
B.Client initiates key exchange, both parties compute shared secret, then encrypt subsequent traffic. ✅
C.Server sends its private key first, client verifies, then starts encryption.
D.Both sides exchange passwords before any encryption is applied.
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: Option B is correct because the SSH handshake begins with a key‑exchange algorithm where the client proposes a method, both sides compute a shared secret, and only after this is the session encrypted. The other options describe impossible or insecure orders, such as transmitting encrypted data before a key is established or exposing private keys.

Q2. What does the acronym SSH stand for?

A.Secure Socket Helper
B.Secure Shell ✅
C.Simple Secure Handoff
D.System Service Host
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: SSH stands for Secure Shell. It is a protocol that provides a secure channel over an unsecured network, primarily used for remote login and command execution. The other options are fabricated and do not represent the actual meaning of the acronym.

Q3. How does SSH differ from Telnet in terms of authentication and data confidentiality, and which statement best captures this difference?

A.SSH encrypts only the login credentials, while Telnet encrypts the entire session.
B.SSH uses UDP for transport, whereas Telnet uses TCP, making SSH less reliable.
C.SSH provides both authentication and encryption for the whole session, whereas Telnet offers only clear‑text transmission with optional authentication. ✅
D.Telnet supports public‑key authentication natively, while SSH relies on passwords.
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: Option C correctly reflects that SSH secures the entire communication channel with both authentication (often via public‑key) and encryption, whereas Telnet transmits data in clear text and only optionally verifies identity. The other statements contain technical inaccuracies regarding transport protocols and encryption scopes.

Q4. If an administrator wants to enforce password‑less login using public‑key authentication, which principle of public‑key cryptography must be correctly applied to ensure security?

A.The client must prove possession of the private key that corresponds to a public key stored on the server. ✅
B.The server must store the client’s password in an encrypted form.
C.Both client and server share a symmetric key generated during login.
D.The client must send its private key over the network for verification.
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The correct principle is that the client proves it holds the private key matching a public key authorized on the server, typically via a signature challenge. This ensures password‑less authentication while keeping the private key secret. Storing passwords or transmitting private keys would compromise security, and SSH does not rely on symmetric keys for initial authentication.

Q5. A client receives a host key fingerprint that does not match the stored fingerprint for a server. Assuming the network is secure, what is the most plausible inference?

A.The server is down for maintenance.
B.The client’s SSH version is outdated.
C.The network is experiencing high latency.
D.The server’s host key has changed or a man‑in‑the‑middle attack is occurring. ✅
💡 Difficulty: easy | ✅ Correct: D

📖 Explanation: When the fingerprint differs, the most logical inference is that the server’s host key has changed, which could be legitimate (e.g., after regeneration) or indicate a man‑in‑the‑middle attack. The other options do not directly explain a fingerprint mismatch.

Q6. What is the likely impact on performance and security when SSH compression is disabled on a high‑latency link?

A.Disabling compression will always improve security without affecting performance.
B.It will reduce latency but make the connection vulnerable to packet injection attacks.
C.It may increase bandwidth usage and latency, but eliminates the risk of compression‑based attacks such as CRIME. ✅
D.It will double the CPU usage on both ends while providing no security benefit.
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: Disabling compression removes the extra processing overhead and prevents attacks that exploit compression side‑channels (e.g., CRIME). However, on high‑latency links the lack of compression can increase the amount of data transmitted, leading to higher bandwidth consumption and potentially longer transfer times.

Q7. Design a step‑by‑step procedure to replace password authentication with certificate‑based authentication in an enterprise SSH deployment, ensuring backward compatibility during the transition.

A.1. Generate a CA key pair. 2. Issue user certificates signed by the CA. 3. Distribute the CA public key to all SSH servers via trusted‑user‑ca‑keys. 4. Configure servers to accept certificate authentication and keep password authentication enabled. 5. Deploy certificates to users. 6. Gradually phase out password authentication after verification. ✅
B.1. Replace all user passwords with the same static key. 2. Disable public‑key authentication. 3. Restart SSH service. 4. No need for CA.
C.1. Enable password authentication, then switch to certificates without updating server config. 2. Restart services.
D.1. Generate host keys only, ignore user keys, and rely on host verification.
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: Option A outlines a secure migration: creating a Certificate Authority, issuing user certificates, configuring servers to trust the CA while retaining passwords, rolling out certificates, and finally retiring password authentication. This maintains service continuity and allows verification before decommissioning passwords. The other options either remove security, skip essential steps, or ignore user authentication entirely.

Q8. If a system administrator disables host key verification in SSH client configuration, which of the following vulnerabilities is most directly introduced?

A.Increased resistance to brute‑force attacks.
B.Susceptibility to man‑in‑the‑middle attacks because the server’s identity is not verified. ✅
C.Improved performance due to faster handshake.
D.Automatic key rotation.
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Turning off host key verification removes the check that ensures the client is connecting to the intended server. This opens the connection to man‑in‑the‑middle attacks, where an attacker could present a forged host key and intercept or alter traffic. The other options describe unrelated effects.

Q9. Compare SSH tunneling with a site‑to‑site VPN for providing remote access to internal services. Which statement most accurately reflects their trade‑offs in scalability and security?

A.SSH tunneling scales better than VPN because it requires no additional infrastructure, but it provides weaker encryption.
B.VPN offers per‑packet encryption while SSH tunneling encrypts only the initial handshake, making VPN more secure.
C.SSH tunneling cannot forward multiple ports simultaneously, whereas VPN can, making VPN more flexible but less secure.
D.SSH tunneling is simpler to configure for single services and offers strong end‑to‑end encryption, while VPN provides site‑wide connectivity with higher overhead, affecting scalability. ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: Option D correctly captures that SSH tunneling is straightforward for forwarding specific ports and delivers strong encryption for those streams, whereas a VPN creates a broader network tunnel, offering site‑wide access but incurring more configuration complexity and performance overhead. The other statements misrepresent encryption scopes or scalability characteristics.

🔗 Related Topics (MCQs)