How does SSH work and what are its basic usage patterns?

Answer

SSH (Secure Shell) provides encrypted remote login over an untrusted network. Basic usage: ssh user@host connects to a remote server. ssh -p 2222 user@host uses a non-default port. SSH supports two authentication methods: password-based and key-based. For key-based auth, generate a key pair with ssh-keygen -t ed25519 and copy the public key to the server with ssh-copy-id user@host. Configuration in ~/.ssh/config lets you define aliases: Host myserver then ssh myserver. Use ssh -L 8080:localhost:3000 user@host for local port forwarding (tunneling). Key-based auth is more secure than passwords and should always be preferred for production servers.