Progress: 0/62 (0%)

🔐 Using SSH

Using SSH

SSH stands for Secure Shell. Think of it as a secure tunnel that lets you connect to another computer over the internet or a local network. Unlike older tools like Telnet, SSH encrypts your data, so nobody can eavesdrop on your passwords or files.

SSH Basics

SSH is used to log in to remote machines securely, run commands on a remote server, and transfer files safely between computers.

  • Log in to remote machines → securely access another computer.
  • Run commands remotely → execute commands on a distant system.
  • Transfer files safely → move files between computers securely.

SSH Command

ssh username@remote_host
📌 Example:
ssh alice@192.168.1.10

In this command, alice is the user on the remote system and 192.168.1.10 is the IP address or hostname of the remote system. SSH will prompt for your password (unless you use SSH keys), and once connected, you get a remote terminal — you're "inside" that computer now.

SCP (Secure Copy)

scp is like SSH but for copying files. You can copy files to or from a remote system.

scp file.txt alice@192.168.1.10:/home/alice/

This command copies a file to a remote system.

scp alice@192.168.1.10:/home/alice/file.txt .

This command copies a file from a remote system to your current directory. It's like sending a package through a secure courier instead of just dropping it in someone's mailbox.

SFTP (Secure FTP)

sftp gives you an interactive file transfer session over SSH.

sftp alice@192.168.1.10

Once inside an SFTP session, you can use commands like:

  • ls → list files
  • cd → change directory
  • get file.txt → download file
  • put file.txt → upload file

Real-life analogy

Imagine you want to send a letter to a friend across town. Sending it in a regular envelope is like Telnet — anyone can peek. Sending it in a locked, secure box is like SSH — only your friend with the key can open it. For SFTP, imagine you're walking inside the other computer's folder system with a secure flashlight — you can move files around safely. SSH is basically your all-in-one secure bridge: login, run commands, and move files safely.