What Is SSH (Secure Shell)?

Category: VPS & Cloud ยท Updated 2026-11-08

SSH (Secure Shell) is a network protocol that lets you log into a remote server and run commands on it through an encrypted connection, typically over port 22. It replaced older, unencrypted tools like Telnet, and it is the standard way to manage a VPS or dedicated server from a command line, transfer files securely, and run automated scripts.

What SSH is used for

SSH gives you a remote command-line session on a server, as if you were typing directly on its keyboard, but over the internet and fully encrypted. It is the standard way to administer a VPS, a dedicated server or a cloud instance that does not come with a graphical desktop. Beyond running commands, the same SSH connection can carry other tools:

UseWhat it does
Remote shellRun commands and manage files directly on the server
SFTP / SCPSecurely upload or download files over the same encrypted channel
Port forwarding / tunnelsSecurely access a remote service, such as a database, without exposing it publicly
Git over SSHPush and pull code from repositories using SSH instead of HTTPS
Automated scriptsRun deployment or backup commands on a remote server from a local script or CI pipeline

How an SSH connection is established

  1. Your SSH client connects to the server, usually on TCP port 22.
  2. The server presents its host key, which your client checks against a known list to confirm you are talking to the right machine and not an impostor.
  3. The client and server negotiate encryption for the session, so everything sent afterward is unreadable to anyone intercepting the traffic.
  4. You authenticate, either with a password or, more securely, with an SSH key pair.
  5. Once authenticated, you get an interactive shell or run a single command, and the session stays encrypted until you disconnect.

Connecting with SSH from a terminal

# Connect to a server using the default port
ssh username@203.0.113.10

# Connect using a non-default port
ssh -p 2222 username@203.0.113.10

# Connect using a specific private key file
ssh -i ~/.ssh/id_ed25519 username@203.0.113.10

# Copy a file to the server
scp report.pdf username@203.0.113.10:/home/username/

Password vs. key-based login

SSH supports logging in with a password, but most server administrators switch to key-based authentication, where a private key stays on your computer and a matching public key is placed on the server. Keys are both more convenient, since they avoid typing a password every time, and more resistant to automated password-guessing attacks.

Basic SSH security practices

  • Use SSH keys instead of passwords where possible, and protect the private key with a passphrase.
  • Disable direct root login and use a regular account with sudo instead.
  • Keep the server's firewall limited to the ports you actually need.
  • Consider changing the default port 22 to reduce automated scanning noise, as a minor extra layer, not a replacement for strong authentication.
  • Install a tool such as fail2ban to block IP addresses after repeated failed login attempts.

Frequently asked questions

What does SSH stand for?

SSH stands for Secure Shell. It is both the name of the protocol and, informally, the name people use for the encrypted remote terminal session it creates.

What port does SSH use?

SSH uses TCP port 22 by default. Some administrators configure a different port as a minor extra step against automated scans, but the server and client must agree on whichever port is used.

Is SSH the same as FTP?

No. SSH gives you a command-line session to run commands on a server. FTP and its secure cousin SFTP are specifically for transferring files; SFTP actually runs over the SSH protocol, while plain FTP is unrelated and unencrypted.

How do I connect to a server with SSH?

From a terminal, run a command such as ssh username@server-ip-address, then authenticate with a password or an SSH key. Windows users can use the built-in ssh command in PowerShell, or a graphical client such as PuTTY.

Is SSH secure?

Yes, when configured properly. SSH encrypts the entire session and supports strong key-based authentication; most real-world risk comes from weak passwords, leaked private keys or outdated software rather than a flaw in the protocol itself.

Does shared hosting include SSH access?

Some shared hosting plans include limited SSH access for tasks like running WP-CLI or Composer, but many restrict or omit it entirely. A VPS or dedicated server almost always includes full SSH access with root or administrator privileges.

Related topics