SSH Checks Both Ends of a Remote Login
Secure Shell, or SSH, is a protocol for protected remote login and related communication between computers. It lets someone run commands on another machine or transfer files over a connection designed to resist eavesdropping and tampering. Before the useful work begins, both sides have identity questions to answer.
A protocol is a set of communication rules. The computer starting the connection runs an SSH client; the remote computer provides the SSH server. OpenSSH is one implementation of those rules, not another name for the protocol itself.
The SSH architecture specification separates three jobs: establishing a protected connection and checking the server, checking the user, and carrying the work that follows.
Two Remote Logins, One Crucial Security Difference
Is this the server you meant to reach?
Encryption can hide traffic from an eavesdropper, but it doesn't by itself establish whose computer receives it. Encrypting a conversation with an impostor still gives the impostor the information you send.
An SSH server has a host key used to establish its identity. A key is a data value used in a mathematical security check. Here, the server proves it can use the private part of its key pair, while the client checks the public part.
The client also needs a reason to associate that key with the intended server. Otherwise, an active intermediary could present a different key and pretend to be the destination.
OpenSSH illustrates how this check becomes visible to a user. On a first connection it can display a fingerprint, a compact representation of the host key, for comparison with a trusted value. It records known host keys and warns if a server's identification later changes.
The OpenSSH manual describes these checks. A changed key calls for verification. It isn't automatically proof of an attack, but dismissing the warning without checking removes the opportunity to find out why the identity changed.
Is this user allowed to sign in?
The server has a different question: who is requesting access, and do they have an accepted way to prove it?
SSH supports several authentication methods. Authentication means checking a claimed identity. In password authentication, the password is sent inside the protected connection rather than as exposed network text.
With public-key authentication, the user has a public/private key pair. The private key creates a digital signature, a value the server can check using the public key. The private key itself isn't sent as the proof.
The server checks more than whether the signature is mathematically valid. It also checks whether that public key is authorized for the requested login. A valid signature from an unknown key doesn't automatically earn access.
The SSH authentication specification describes this process. A server may require additional checks, and not every server accepts every method.
These login keys and the server's host key have different jobs. One helps the client recognize the server; the other helps the server recognize an authorized user.
- Make a stolen password useless without the key in your hand.
- Sign in with a tap instead of typing a code.
- Protect Google, Microsoft, Apple and more than 1,000 other accounts.
The connection carries work; permissions govern the work
After the checks, SSH can carry a remote command or provide a shell, a program that interprets commands. It can also carry file-transfer traffic.
SFTP is a file-transfer protocol carried over SSH. It uses SSH's protected transport and can use its authentication methods, as described in the OpenSSH SFTP manual.
The receiving system still decides which operations the signed-in account may perform. Being able to log in doesn't mean being allowed to read every file or change every setting. Authentication and authorization answer different questions: who has been checked, and what they're permitted to do.
SSH also doesn't repair a compromised computer at either end. The connection may protect a command while it travels, yet the command still runs on the destination under that account's permissions. Protection in transit and control of the machines remain separate responsibilities.
What Is a Public Key, and Why Is It Safe to Share?

Telnet: Why Ordinary Sessions Expose What You Type

Tatu Ylönen: A Password Theft Leads to SSH

QUOTE:
"Amateurs hack systems, professionals hack people."
