Secure Shell
Summary
Secure Shell (SSH) provides an encrypted command-line connection to remote systems on TCP port 22, along with secure file transfer and tunneling. It replaced insecure protocols such as Telnet. Public key authentication is stronger than passwords and is standard for administrators and automation.
In plain words
SSH gives an encrypted command-line session for remote administration, and SFTP/SCP for file transfer. The server proves its identity with a host key. Users can authenticate with a password, a public key (listed in the server's authorized keys), or Kerberos. Managing keys matters: remove old or compromised keys and regenerate them.
Detailed explanation
- Secure Shell (SSH): A protocol for encrypted remote command-line access, file transfer (SFTP and SCP) and port forwarding.
- Host key: The server's key pair; the client records its fingerprint on first connection and warns if it later changes, which could signal an impostor server.
Client authentication
- Password authentication: Simple but vulnerable to guessing; disable it where possible.
- Public key authentication: The client proves possession of a private key whose public key is listed in the server's authorized keys file.
- Kerberos: SSH can use Kerberos tickets in a domain environment.
Good practice
- Key management: Protect private keys with passphrases, remove old authorized keys and track who holds keys.
- Hardening: Disable direct root sign-in, allow only named users, and limit access by network.
- Telnet: The insecure predecessor on port 23 that sends everything in plaintext.
Important terms
taken from the text above- Secure Shell (SSH)
- A protocol for encrypted remote command-line access, file transfer (SFTP and SCP) and port forwarding.
- Host key
- The server's key pair; the client records its fingerprint on first connection and warns if it later changes, which could signal an impostor server.
- Password authentication
- Simple but vulnerable to guessing; disable it where possible.
- Public key authentication
- The client proves possession of a private key whose public key is listed in the server's authorized keys file.
- Kerberos
- SSH can use Kerberos tickets in a domain environment.
- Key management
- Protect private keys with passphrases, remove old authorized keys and track who holds keys.
- Hardening
- Disable direct root sign-in, allow only named users, and limit access by network.
- Telnet
- The insecure predecessor on port 23 that sends everything in plaintext.
Examples & real-world scenarios
- ssh admin@10.1.0.10 to reach a Linux server.
- ssh-keygen to make a key pair and ssh-copy-id to install the public key.
- scp to copy a log file from a server for review.
Scenario
An administrator leaves the company. Their public key must be removed from every server's authorized keys, or it still grants access. Tracking SSH keys is part of account deprovisioning.
Common mistakes
- Forgetting that SSH keys are credentials that need lifecycle management.
- Ignoring a changed host key warning. It could mean the server is being impersonated.
Practical skills
- Set up key-based SSH authentication in your own lab.
- Explain why host keys matter.
What I should remember
- SSH: Encrypted remote administration on port 22.
- Public key authentication: Stronger than passwords for SSH.
- Host key: Lets clients detect an impostor server.
- SFTP: Secure file transfer that runs over SSH.