What is SSH and How Does it Work? | An Easy Explanation (2024)

The Secure Shell Protocol (SSH) is used in SSH File Transfer Protocol, also known as secure file transfer protocol (SFTP), but it can also be used on its own for secure remote login from one computer to another. SSH was developed by Tatu Ylönen in 1995 and published as freeware for anyone to use.

What is SSH used for?

Before SSH was developed, people were connecting over unsecured networks and had no way to secure them. SSH solves this problem by encrypting the connection between two machines.

SSH can also be used to

  • Authenticate the client and server and generate a session key in SFTP file transfers.
  • Keep a transmission control protocol (TCP) connection alive with commands so that you can reuse the TCP connection with new SSH connections.
  • Remember private keys during a session so you only enter a passphrase once for all windows and applications.
  • Connect to insecure/unsecure applications and systems.
  • Get to devices on a private network that you need to access by using SSH as a proxy.

How does SSH work?

SSH encrypts data so that someone trying to intercept the message cannot read what’s being sent. They only know that data is being transmitted across and how frequently it’s happening.

  1. TCP connection is established through a three-way handshake.
  2. TCP is a connection-oriented protocol, which means that both computers verify a connection before data is sent. This keeps data from being sent out of order or in pieces.

    TCP verifies the connection with a three-way handshake.

    Here’s how it works:

    1. Sending computer sends a message called a SYN.
    2. Receiving computer sends back an acknowledgement message called a SYN ACK.
    3. Sending computer sends an ACK RECEIVED MESSAGE to the receiving message.

    After the handshake is complete, data is delivered. If data doesn’t arrive, TCP will make sure that it is re-sent.

  3. The client verifies the server.
  4. If the client is accessing the server for the first time, the client has to manually authenticate the server by verifying its public key.

    If the client isn’t accessing the server for the first time, the client’s known_hosts file already has the server’s public key. The server is authenticated.

  5. The client and server generate a session key together.
  6. The client and server agree on a session key that will be used to encrypt and decrypt the data for that session. Because a different session key is used each time, anyone who figures out one session key can only read data from that session. They wouldn’t be able to read data from past or future sessions.

  7. The server authenticates the client.
  8. The client is authenticated with an SSH key pair. The pair consists of two keys:

  • Public key – Encrypts data and can be shared with anyone.
  • Private key – Decrypts data and cannot be shared with anyone.

The server generates a random number, uses the client’s public key to encrypt the number and sends it to the client.

The client uses its private key to decrypt the message and get the server’s random number. The client calculates an MD5 hash of the random number and sends it back to the server.

The server calculates an MD5 hash of the random number and compares it with the client’s value. If they match, the client is authenticated.

  • The data is broken down into packets that have message authentication codes (MACs).
  • A MAC is exactly what it sounds like. It confirms that the message is coming from the stated sender and that it hasn’t been changed in transit.

  • The packets are encrypted and sent.
  • At the receiving end, the data is decrypted and put back together.
  • Is SSH over TCP or UDP?

    SSH uses TCP, not UDP (User Datagram Protocol). Unlike TCP, UDP is a connectionless protocol, which means it doesn’t make sure the recipient is ready to receive files before sending them. As a result, data can arrive out of order, in pieces or not at all.

    Although SSH typically uses TCP, it doesn’t have to. It can also be run over an RS-232 connection.

    Is SSH more secure than telnet?

    Yes. Any data transferred with telnet (port 23) is transmitted in clear text, which means anyone with a packet sniffer can read the data and steal it. SSH encrypts data so it cannot be read or stolen by anyone other than the sender and the recipient.

    Does SSH use TLS or SSL?

    SSH doesn’t use Transport Layer Security (TLS) protocols or Secure Socket Layer (SSL).

    To be clear, TLS is the successor to SSL, so they’re considered synonyms. TLS/SSL is used for encryption in the HTTPS and FTPS protocols, not the SFTP protocol.

    What is the difference between SSH and SSL?

    The biggest difference between SSH and TLS/SSL is in what they’re used for. SSH encrypts a connection between two computers and can execute commands. TLS/SSL encrypts data in transit as well, but it’s typically in a website browser with HTTPS. You can’t issue commands with TLS/SSL.

    Here are some other differences between SSH and TLS/SSL:

    SSHTLS/SSL
    Based on network tunnelsBased on digital certificates
    Runs on port 22Runs on port 443
    Requires client and server to authenticateOnly requires authentication on server side
    Cryptographic network protocolSecurity protocol

    What is the difference between SSH and FTP?

    The biggest difference between SSH and FTP is that SSH encrypts data and FTP doesn’t. FTP sends data, usernames and passwords unencrypted, which makes it vulnerable to a man-in-the-middle attack. SSH encrypts the data being sent so that no one can read and steal it.

    Is SSH faster than FTP?

    SSH is slower than FTP because it encrypts data and has other security measures in place. Data transfer speed can also be affected by the speed of each machine’s disk, the speed of the network, network tuning and machine tuning.

    Diving into SFTP

    One of the most common use cases of SSH is in SFTP. To see a detailed guide about how SFTP works, visit our What is SFTP page.

    Advanced Secure Shell: 6 Things You Can Do With SSH

    What is SSH and How Does it Work? | An Easy Explanation (2024)
    Top Articles
    Top 10 foods to try in Sweden
    Buy Best Commercial Vehicle Insurance with Top Benefits | SGI Phills
    Katie Pavlich Bikini Photos
    Gamevault Agent
    Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
    Free Atm For Emerald Card Near Me
    Craigslist Mexico Cancun
    Hendersonville (Tennessee) – Travel guide at Wikivoyage
    Doby's Funeral Home Obituaries
    Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
    Select Truck Greensboro
    Things To Do In Atlanta Tomorrow Night
    How To Cut Eelgrass Grounded
    Pac Man Deviantart
    Alexander Funeral Home Gallatin Obituaries
    Craigslist In Flagstaff
    Shasta County Most Wanted 2022
    Energy Healing Conference Utah
    Testberichte zu E-Bikes & Fahrrädern von PROPHETE.
    Aaa Saugus Ma Appointment
    Geometry Review Quiz 5 Answer Key
    Walgreens Alma School And Dynamite
    Bible Gateway passage: Revelation 3 - New Living Translation
    Yisd Home Access Center
    Home
    Shadbase Get Out Of Jail
    Gina Wilson Angle Addition Postulate
    Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
    Walmart Pharmacy Near Me Open
    Dmv In Anoka
    A Christmas Horse - Alison Senxation
    Ou Football Brainiacs
    Access a Shared Resource | Computing for Arts + Sciences
    Pixel Combat Unblocked
    Cvs Sport Physicals
    Mercedes W204 Belt Diagram
    Rogold Extension
    'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
    Teenbeautyfitness
    Weekly Math Review Q4 3
    Facebook Marketplace Marrero La
    Nobodyhome.tv Reddit
    Topos De Bolos Engraçados
    Gregory (Five Nights at Freddy's)
    Grand Valley State University Library Hours
    Holzer Athena Portal
    Hampton In And Suites Near Me
    Stoughton Commuter Rail Schedule
    Bedbathandbeyond Flemington Nj
    Free Carnival-themed Google Slides & PowerPoint templates
    Otter Bustr
    Selly Medaline
    Latest Posts
    Article information

    Author: Maia Crooks Jr

    Last Updated:

    Views: 5761

    Rating: 4.2 / 5 (43 voted)

    Reviews: 90% of readers found this page helpful

    Author information

    Name: Maia Crooks Jr

    Birthday: 1997-09-21

    Address: 93119 Joseph Street, Peggyfurt, NC 11582

    Phone: +2983088926881

    Job: Principal Design Liaison

    Hobby: Web surfing, Skiing, role-playing games, Sketching, Polo, Sewing, Genealogy

    Introduction: My name is Maia Crooks Jr, I am a homely, joyous, shiny, successful, hilarious, thoughtful, joyous person who loves writing and wants to share my knowledge and understanding with you.