SSH
Secure Shell (SSH) is a protocol for securely connecting to a remote computer. It lets you open a terminal, run commands, or transfer files over an encrypted connection.
What SSH is for
Suppose a deployment fails and you need to check disk space on a Linux server. SSH lets you run that check from your laptop without being at the server's console. The command runs on the server with the permissions of the account you logged in as. SSH is the protocol; OpenSSH is a common implementation. In OpenSSH, ssh is the client command and sshd is the service that listens for connections.
Two identities to verify
An SSH connection usually starts over TCP port 22, although a server can listen on a different port. During the handshake, the client and server establish encryption keys for the session. The server also proves it holds the private part of its host key. The client checks that the corresponding public key belongs to the intended server, often by comparing it with an entry in ~/.ssh/known_hosts. For a first connection, verify the host key fingerprint against a trusted source before accepting it.
Once the secure channel is established, the server checks who is allowed to log in. With public-key authentication, the client signs data using the user's private key. The server verifies the signature and checks that the corresponding public key is authorized for the requested account, often through ~/.ssh/authorized_keys on the server. The private key never needs to leave the client. If the server allows password authentication, the password travels inside the encrypted channel.
Try a shell or a single command
ssh ops@server.example.com
ssh ops@server.example.com 'df -h'
The first command opens an interactive shell as ops. The second runs df -h on the remote server, prints its filesystem usage locally, and exits. SSH also carries SFTP file transfers, provides access to Git repositories, and lets tools such as Ansible manage remote machines.
What interviewers look for
Troubleshooting starts with identifying which stage failed. A TCP connection timeout points you toward the address, port, or network path. Permission denied (publickey) means you reached user authentication, but none of the public-key attempts succeeded. Check the account name, which key the client offered (ssh -v can show this), and whether that key is authorized for the account.
A changed host key is a different problem: the client can no longer confirm that it is talking to the same server. A rebuild can explain the change, but so can server impersonation. Verify the new fingerprint through a trusted channel, such as your provider's management console, before updating known_hosts. Don't disable host verification just to make the warning go away.