SSH: secure connections to remote computers
SSH (Secure Shell) is a protocol that allows you to connect securely and encrypted to another computer over a network.

Before Starting
SSH (Secure Shell) is a protocol that allows you to connect securely and encrypted to another computer over a network. It is mainly used for managing remote servers or computers from the terminal. It works through public and private keys or passwords, and encrypts all communication to prevent espionage or data theft.
Managing remote computers would be hell without SSH:
-
You couldn't access your server if you're far away or without physical access.
-
You couldn't transfer files securely between your PC and a server.
-
You couldn't automate tasks (like updates or backups) across multiple computers at once.
-
And if a system fails in production, SSH lets you fix it in minutes without leaving your desk.
SSH exists for all those kinds of problems.
SSH works through an encrypted channel between two machines: a client (your PC) and a remote server. Its main purpose is to guarantee authentication, confidentiality and integrity in communication.
Authentication
SSH uses two main methods:
-
Password: simple, but less secure.
-
Public/Private Keys: the client stores a private key, and the server stores a public one; if they match, access is granted without needing a password.
Encryption
All information (commands, files, responses, etc.) travels encrypted with asymmetric and symmetric algorithms, preventing anyone from intercepting useful data, even if they spy on the connection.
Connection and tunnels
SSH can create secure tunnels (port forwarding), which allows you to redirect traffic from other applications (such as databases or websites) privately. It can also be used as a basis for lightweight VPNs or to expose internal services without publicly opening ports.
Common uses
-
Remote access: run commands on another computer as if you were there.
-
File transfer: with scp or sftp, without needing FTP.
-
Automation: in scripts for repetitive tasks or deployments.
-
Tunnels and proxy: to connect private networks or access internal resources.
In summary, SSH is not just for "accessing a server", it is the backbone of modern remote administration: fast, secure and flexible.
Getting Started
There are two main ways to use SSH, directly in the terminal or using a VS Code extension.
SSH in terminal
If you know your way around the terminal, this is by far the most convenient option, as it gives you total freedom for what you want. The procedure to connect is the same on Windows, Linux or macOS.
💡 If you are not an expert in the terminal, don't worry, it will probably be more convenient for you to use SSH in VS Code.
Windows, Linux and macOS
- Open the terminal.
- Connect directly by typing:
Example:bash
ssh user@ip_or_domainbashssh someone1@192.168.1.1 ssh someone2@udec.cl - If it's your first time connecting, it will tell you that the connection could not be established. This is completely normal! Your device doesn't recognize the other one, so to trust it and continue, you must accept with
yes. - Enter your password and Done! Now you are in the terminal of the other device, but from yours.
⚠️ If you use older versions of Windows there is a possibility that SSH is not installed and you will need to install it or use other external terminals.
SSH in VS Code
Connecting to a machine with SSH through VS Code is probably the most convenient thing there is. You can work in an environment you already know and take advantage of all its tools.
Steps to connect:
- Install the Remote - SSH extension.
- Open the command palette (Ctrl + Shift + P) → search for
Remote-SSH: Connect to Host. - Enter the device address:
user@ip_or_domain - Another window will open asking you for the platform of the device you want to access. There you should select Linux, Windows or macOS.
- Then it will ask you for your user key; enter it and Done! 🎉
Now just open the directory you want and you can start working.
💡 Remember that if you want to use the terminal you can also do it from the same VS Code. ⚠️ You will need to install again the extensions you need to use in VS Code.
You can also save the device address, so you don't have to enter it every time, in the following way:
- Open the command palette (Ctrl + Shift + P) → search for
Remote-SSH: Connect to Host. - Select + Add New SSH Host...
- Enter the device address:
user@ip_or_domain - Choose the file where you want to save the configuration.
- Windows:
C:\Users\YourUser\.ssh\config - Linux:
~/.ssh/config
- Windows:
- Now the host is saved; you can already connect as indicated at the beginning, but by selecting your host instead of typing it.
Here are some tips to follow when using SSH.
Tips for the client:
-
Use SSH keys instead of passwords. They are much more secure and prevent brute force attacks.
-
Protect the private key with a passphrase. That way, even if someone obtains it, they won't be able to use it.
-
Keep the
~/.ssh/configfile organized, with aliases and configurations per host. -
Review and clean up known keys (
known_hosts) to avoid conflicts or false positives. -
Avoid using root directly; connect with a normal user and then use
sudo.
Tips for the server:
-
Disable password access (
PasswordAuthentication no) and force the use of keys. -
Change the default port (22) to reduce automatic attack attempts.
-
Use firewalls or fail2ban to block repeated failed connection attempts.
-
Restrict access by IP in the
sshd_configfile if use is limited. -
Update OpenSSH regularly to fix vulnerabilities.
-
Log and monitor access with logs to detect suspicious activity.
Together, these practices make your SSH connection secure, reliable and difficult to compromise.
Common mistakes when using SSH that could compromise its security and reliability.
Bad practices of the client:
-
Store the private key without a passphrase (total risk if someone accesses your PC).
-
Use simple or repeated passwords to connect to different servers.
-
Copy the private key to the remote server (only the public one should go there).
-
Ignore warnings from the
known_hostsfile, which may indicate spoofing. -
Connect as root directly, unnecessarily, exposing full permissions.
Bad practices of the server:
-
Leave password access enabled, facilitating automatic attacks.
-
Do not limit connection attempts, allowing indefinite brute force.
-
Do not update OpenSSH or the operating system, leaving security holes.
-
Use port 22 without a firewall, making it visible to any bot or attacker.
-
Give SSH access to all system users, without control or clear permissions.
Even if you perform any of these practices it doesn't mean an immediate problem, it's not a reason to use them and expose yourself to future security issues.
Extras
Here are some extra resources about SSH
Official documentation and guides:
-
Official page of the OpenSSH project, with documentation and downloads.
-
Complete detail of commands, flags and configuration.
-
Practical guide to install and use SSH on Ubuntu-based distributions.
Learning and tutorials:
-
Step by step tutorial for beginners.
-
Clear explanation of how SSH works and the security behind it.
-
Educational resources on SSH, encryption and secure administration.
Advanced security:
-
Complete guide to harden SSH server configuration.
-
How to protect your server from brute force attacks with Fail2Ban.
-
OpenSSH. (n.d.). OpenSSH: Portable OpenSSH. Retrieved November 11, 2025, from https://www.openssh.com/
-
DigitalOcean. (2023). How To Use SSH to Connect to a Remote Server. DigitalOcean Tutorials. Retrieved from https://www.digitalocean.com/community/tutorials/how-to-use-ssh-to-connect-to-a-remote-server
-
The Linux Foundation. (2024). SSH Man Page (ssh(1)) in Linux man-pages project. Retrieved from https://man7.org/linux/man-pages/man1/ssh.1.html
-
SSH Communications Security. (2024). SSH Academy. Retrieved from https://www.ssh.com/academy/ssh
Authors

GIIA