Hasty Briefsbeta

Bilingual

An Excruciatingly Detailed Guide to SSH

6 hours ago
  • #network-security
  • #port-forwarding
  • #SSH
  • SSH local port forwarding (-L) creates a local port that forwards to a remote port, useful for accessing services on a loopback interface.
  • Remote port forwarding (-R) forwards a remote port to a local port, enabling access from an external machine through an intermediate server.
  • Dynamic port forwarding (-D) sets up a SOCKS proxy for routing all traffic through an SSH tunnel, useful for proxying web browsing.
  • Jump hosts (-J) allow SSH connections to pass through one or more intermediate servers to reach a final destination.
  • Agent forwarding (-A) forwards SSH keys from a local agent to a remote server, facilitating authentication without re-entering passwords.
  • TTY command allocation (-t) runs interactive commands like 'top' or 'vim' on a remote server via SSH.
  • Global port (-g) makes locally forwarded ports accessible from external machines, similar to -L but with broader accessibility.
  • The SSH console (~?) provides hidden controls, such as killing sessions (~.) or creating port forwards on-the-fly (~C).
  • SSH config files (~/.ssh/config) store connection settings, including keywords like IdentityFile, ForwardAgent, ProxyJump, and Match for conditional configurations.
  • Utilities like ssh-copy-id upload public keys to servers, and ssh-keygen generates key pairs, supporting algorithms like RSA and ECDSA.