SSH (Secure Shell) is a network protocol that lets you securely manage a remote computer or server from the command line over an encrypted channel. It's used to administer VPS instances, transfer files, and forward ports. Below we'll cover how the protocol works, why it beats older alternatives, and how to connect to a server.

SSH in plain terms

SSH is the Secure Shell protocol that establishes an encrypted connection between your computer and a remote server, letting you type commands as if you were sitting right at its keyboard.

Think of it as a long, secure "extension cord" for your terminal: you type a command locally, it gets encrypted, travels over the network to the server, runs there, and the result comes back to you just as securely. If someone intercepted the traffic, all they'd see is a stream of unreadable data.

SSH works on a client-server model. An SSH client runs on your device, while an SSH server (most commonly OpenSSH) runs on the remote machine. By default, the server listens for connections on port 22.

What SSH is used for

  • Server administration. Installing software, editing config files, restarting services, checking logs — all from the command line.

  • File transfers. SFTP and scp run on top of SSH, copying files in encrypted form.

  • Tunneling. SSH lets you forward a port and reach a private service as if it were running locally.

  • Working with Git. Many services let you clone and push repositories over SSH using key-based authentication.

  • Automation. Scripts and deployment systems connect to servers over SSH without any human involved.

For a VPS owner, this is the primary way to manage a server without a graphical control panel.

How SSH works

A connection goes through several stages, all happening within a fraction of a second:

  1. Establishing the connection. The client reaches out to the server using its IP address or domain name and port (22 by default). Both sides agree on the protocol version.

  2. Negotiating encryption and exchanging keys. The client and server pick algorithms and use asymmetric cryptography to securely derive a shared secret. All further traffic is then encrypted with fast symmetric encryption based on that secret. The secret itself never has to travel over the network.

  3. Verifying the server's identity. The server presents its key, and the client checks its fingerprint. On the first connection, SSH asks whether you trust this server and saves the fingerprint in the known_hosts file. If the fingerprint changes on a later connection, the client will show a warning — you might be connecting to the wrong server.

  4. User authentication. You prove you're allowed to log in, either with a password or an SSH key.

  5. Session. Once logged in, a command-line shell opens, and everything you type and receive travels through the encrypted channel.

In simple terms: asymmetric encryption is used to securely "introduce" the two sides and agree on a secret, while symmetric encryption handles fast encryption of the actual data exchange.

SSH organizations

SSH vs. Telnet: what's the difference

Before SSH, Telnet was commonly used for remote access. Its main flaw: logins, passwords, and commands are sent as plain text, so anyone intercepting the traffic can read them. Telnet isn't used for server management today — SSH has replaced it entirely.

Compared to RDP and VNC, SSH provides text-based rather than graphical access: it's lighter, faster, and doesn't require a desktop environment on the server.

Protocol

Encryption

Typical use

Main OS

SSH

Yes

Server administration, file transfer, tunneling

Linux, macOS, Windows

Telnet

No, data sent as plain text

Legacy remote access, occasionally network equipment debugging

Any

RDP

Yes

Remote desktop

Windows

VNC

Depends on implementation, requires configuration

Graphical remote access

Linux, Windows, macOS

Web console

Depends on the service, usually over HTTPS

Quick browser-based access, e.g. Cockpit

Linux

Authentication methods: password vs. SSH keys

There are two main ways to log in to a server over SSH.

A password is simple: you type it in every time you connect. But passwords can be brute-forced or stolen by someone looking over your shoulder.

An SSH key is a pair of files. The public key is placed on the server, while the private key stays only with you. During login, the client proves it holds the private key without ever sending that key over the network.

Password

SSH key

Convenience

No setup required

Requires generating a key pair once and adding the public key to the server

Resistance to brute force

Depends on password strength

Virtually impossible to brute-force

Risks

Leaks, weak passwords, brute-force attacks

Theft or loss of the private key

Automation

Inconvenient

Convenient

The golden rule: never share or send your private key to anyone — not over messaging apps, not by email. You can add extra protection with a passphrase.

How to connect to a server via SSH

To connect, you'll need three things: the server's IP address (or domain), a username, and either a password or an SSH key. After creating a VPS, these details are usually provided in the control panel or sent by email.

Linux and macOS

Open a terminal and type:

ssh user@192.0.2.10

Here, user is the username on the server, and 192.0.2.10 is the server's IP address (this is an example address — substitute your own). If SSH runs on a non-standard port, add the -p flag, and if you're logging in with a key stored in a non-default location, add -i:

ssh -p 2222 -i ~/.ssh/my_key user@192.0.2.10

Windows

Modern versions of Windows come with a built-in OpenSSH client: the ssh command works in PowerShell and Command Prompt just like on Linux. It's best to check in advance whether your version includes it. An alternative is PuTTY: just enter the address and port, then click "Open".

First connection:

  1. Run the connection command.

  2. The client will display the server's fingerprint and ask whether to continue connecting. If you obtained the fingerprint from a trusted source, such as your hosting provider, verify it and answer yes.

  3. Enter your password (characters won't appear as you type) or, if a key is configured, you'll log in automatically.

  4. Once the server's prompt appears, you're in. Type exit to log out.

SSH security: baseline measures

SSH is considered a secure protocol, but overall security still depends on configuration. A minimal set of measures includes:

  • using SSH keys instead of passwords;

  • disabling root login and working as a regular user with sudo privileges;

  • avoiding weak passwords if password login is still required;

  • installing Fail2ban to block IPs after failed login attempts;

  • keeping the system and OpenSSH regularly updated;

  • optionally changing the port — but keep in mind this isn't real protection, just a way to reduce noise from automated scanners in your logs.

Common connection errors

Error

Likely cause

Connection refused

The SSH server isn't running, the wrong port was specified, or access is blocked by a firewall

Connection timed out

Wrong IP address, the server is down, or traffic is being blocked along the way (firewall, network)

Permission denied

Wrong username, password, or key; login for this user or via password is disabled in the settings

WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

The server's fingerprint has changed — for example, the server was reinstalled. But this could also indicate spoofing, so first make sure the cause is harmless

Conclusion

SSH is the standard way to securely administer Linux servers: it encrypts traffic, verifies the server's identity, and lets you work with a machine without a graphical interface. For reliable operation, use SSH keys along with the baseline security measures.

If you'd like to try SSH in practice, you can connect to a VPS and pick a configuration on the Leneex VPS pricing page.

Frequently asked questions

What is an SSH key?

It's a pair of cryptographic files: the public key is stored on the server, the private key stays with you. The server uses them to verify that it's really you logging in, without ever transmitting a password.

Are SSH and SSL/TLS the same thing?

No. Both encrypt traffic, but SSH is used for remote management and file transfer, while SSL/TLS protects data between a browser and a website (it's what powers HTTPS).

Which port does SSH use?

Port 22 by default. An administrator can change it in the SSH server's settings.

Is it safe to connect to a server over SSH?

Yes, as long as it's configured properly: use keys, keep software updated, and restrict root login. But there's no such thing as absolute security, so the protocol alone isn't enough.

Can I connect via SSH from Windows?

Yes. You can use the built-in OpenSSH client in PowerShell or a program like PuTTY.