- SSH (Secure Shell) is a network protocol that allows secure, encrypted communication between two systems over an unsecured network.
- It is most commonly used to remotely log into servers, execute commands, and transfer files (via SCP/SFTP), replacing older insecure protocols like Telnet and rlogin.
- SSH uses public-key cryptography to authenticate the remote computer and, optionally, to authenticate the user.
- Basic Linux command line usage
- Basic understanding of networking (client-server model, ports)
On most Linux distributions, the SSH client is installed by default. To install the SSH server:
# Debian/Ubuntu
sudo apt update
sudo apt install openssh-server -y
sudo systemctl enable ssh
sudo systemctl start ssh
# RHEL/CentOS
sudo yum install openssh-server -y
sudo systemctl enable sshd
sudo systemctl start sshdVerify it's running:
sudo systemctl status ssh- To get started visit topics/ssh/basics
- To get more advanced examples/hands on visit topics/ssh/advanced
ssh user@host— connect to a remote hostssh -p 2222 user@host— connect on a custom portssh-keygen -t ed25519— generate a new key pairssh-copy-id user@host— copy your public key to a remote hostscp file.txt user@host:/path/— copy a file to a remote hostssh -L 8080:localhost:80 user@host— local port forwarding
- "SSH Mastery" by Michael W Lucas