Interview Q&A / Linux & Shell

INTERVIEW Q&A · 63 QUESTIONS

Linux & Shell interview questions

Permissions, processes, pipes and the commands you are expected to know cold.

  1. How does SSH key-based login work, and how do you set it up?

    You generate a key pair with ssh-keygen, keep the private key on your machine and copy the public key to the server's ~/.ssh/authorized_keys with ssh-copy-id. The server then challenges you to prove you hold the private key, so no password crosses the network.

    BeginnerQuick answer1 min read
  2. What is SSH local port forwarding, and when is it used?

    ssh -L local_port:target_host:target_port user@server opens a port on your machine and tunnels traffic through the SSH server to the target. It lets you reach a service, such as a private database, that is only accessible from the server's network.

    AdvancedQuick answer1 min read