SSH
SSH (Secure Shell) is a cryptographic network protocol that lets you securely log into a remote server, execute commands, transfer files, and forward ports over an encrypted connection.
§ 1 Definition
SSH (Secure Shell) is the standard protocol for secure remote server access. It establishes an encrypted tunnel between your local machine and a remote server, protecting all transmitted data from interception. SSH replaced older, insecure protocols like Telnet and FTP. It is used for server administration, file transfers (SCP, SFTP), tunneled connections (port forwarding), and as the transport layer for Git operations. SSH authentication uses password or, more securely, public-key cryptography. Most hosting and cloud infrastructure management happens through an SSH terminal.
§ 2 How SSH Works
SSH uses a client-server model. The SSH client runs on your local machine. The SSH server (sshd) runs on the remote server, typically listening on port 22. When you connect, the client and server negotiate encryption keys using public-key cryptography. After the encrypted channel is established, the server authenticates you (via password or key pair). With key-based authentication, you generate a public-private key pair, install the public key on the server, and the private key stays on your machine. This is more secure than passwords and enables automated, scripted access.
§ 3 Key Pair Authentication
Key-based authentication is the standard for production servers. Generate a key pair with `ssh-keygen`, copy the public key to the server's `~/.ssh/authorized_keys` file, and connect without entering a password. This is more secure (keys are cryptographic, not guessable) and enables automation (CI/CD pipelines can SSH into servers). Protect your private key with a passphrase and never share it.
§ 4 SSH Beyond Shell Access
SSH does more than remote terminals. SCP and SFTP transfer files over SSH. Port Forwarding tunnels traffic through SSH to access internal services securely (e.g., a database that doesn't expose a public port). SSH Tunnels create encrypted connections to bypass firewalls. SSH Config files simplify connections to multiple servers with custom hostnames, keys, and ports. SSH Agent Forwarding lets you use your local SSH keys through a remote session without copying keys to the remote server.
§ 5 Note
§ 6 In code
```bash
# Generate an SSH key pair
ssh-keygen -t ed25519 -C "[email protected]"
# Copy public key to server
ssh-copy-id [email protected]
# Connect to server
ssh [email protected]
# Run a single command via SSH
ssh [email protected] "df -h && uptime"
# SCP file transfer
scp file.txt [email protected]:~/uploads/
# SSH config file (~/.ssh/config)
Host myserver
HostName 192.168.1.100
User admin
Port 22
IdentityFile ~/.ssh/my_key
# Then just: ssh myserver
```§ 7 Common questions
- Q. Is SSH the same as a terminal?
- A. No. SSH is the secure transport. Once connected, you get a shell (terminal) on the remote server. SSH is the pipe; the shell is what runs through it.
- Q. Can SSH be hacked?
- A. SSH itself is extremely secure when properly configured. The risks are weak passwords, exposed private keys, or outdated server software. Use key-based auth, keep SSH updated, and fail2ban is a good addition.
- SSH provides encrypted remote access to servers for administration and file transfer.
- Key-based authentication is more secure than passwords and enables automated access.
- SSH does more than terminals: SCP, SFTP, port forwarding, and tunnels.
- Disable password authentication on production servers. Keys only.
We configure SSH access as part of every server setup, using key-based authentication and security best practices. WordPress Maintenance plans include secure server access.
Get in touchSSH (Secure Shell) is a cryptographic network protocol that lets you securely log into a remote server, execute commands, transfer files, and forward ports over an encrypted connection.
Category: Security (also: Infrastructure)
Author: Atomic Glue Editorial Team
## Definition
SSH (Secure Shell) is the standard protocol for secure remote server access. It establishes an encrypted tunnel between your local machine and a remote server, protecting all transmitted data from interception. SSH replaced older, insecure protocols like Telnet and FTP. It is used for server administration, file transfers (SCP, SFTP), tunneled connections (port forwarding), and as the transport layer for Git operations. SSH authentication uses password or, more securely, public-key cryptography. Most hosting and cloud infrastructure management happens through an SSH terminal.
## How SSH Works
SSH uses a client-server model. The **SSH client** runs on your local machine. The **SSH server** (sshd) runs on the remote server, typically listening on port 22. When you connect, the client and server negotiate encryption keys using public-key cryptography. After the encrypted channel is established, the server authenticates you (via password or key pair). With key-based authentication, you generate a public-private key pair, install the public key on the server, and the private key stays on your machine. This is more secure than passwords and enables automated, scripted access.
## Key Pair Authentication
Key-based authentication is the standard for production servers. Generate a key pair with `ssh-keygen`, copy the public key to the server's `~/.ssh/authorized_keys` file, and connect without entering a password. This is more secure (keys are cryptographic, not guessable) and enables automation ([CI/CD](/glossary/ci-cd-github-actions) pipelines can SSH into servers). Protect your private key with a passphrase and never share it.
## SSH Beyond Shell Access
SSH does more than remote terminals. **SCP and SFTP** transfer files over SSH. **Port Forwarding** tunnels traffic through SSH to access internal services securely (e.g., a database that doesn't expose a public port). **SSH Tunnels** create encrypted connections to bypass firewalls. **SSH Config files** simplify connections to multiple servers with custom hostnames, keys, and ports. **SSH Agent Forwarding** lets you use your local SSH keys through a remote session without copying keys to the remote server.
## Note
Disable password-based SSH authentication on production servers. Only allow key-based login. Change the default port (22) to reduce log noise from automated attackers, but know this is security-by-obscurity.
## In code
## Common questions Q: Is SSH the same as a terminal? A: No. SSH is the secure transport. Once connected, you get a shell (terminal) on the remote server. SSH is the pipe; the shell is what runs through it. Q: Can SSH be hacked? A: SSH itself is extremely secure when properly configured. The risks are weak passwords, exposed private keys, or outdated server software. Use key-based auth, keep SSH updated, and fail2ban is a good addition.
## Key takeaways
- SSH provides encrypted remote access to servers for administration and file transfer.
- Key-based authentication is more secure than passwords and enables automated access.
- SSH does more than terminals: SCP, SFTP, port forwarding, and tunnels.
- Disable password authentication on production servers. Keys only.
## Related entries
- [VPS](atomicglue.co/glossary/vps)
- [Cloud Hosting](atomicglue.co/glossary/cloud-hosting)
- [CI/CD (GitHub Actions)](atomicglue.co/glossary/ci-cd-github-actions)
Last updated July 2026. Permalink: atomicglue.co/glossary/ssh