Skip to content

FTP, NFS, SMB, TELNET, SSH, RDP

  • uses TCP

  • Data connection -

  • Control Connection

    image.png

  • file sharing protocol, native unix/linux

    image.png

  • clients access files from server using RPC Calls (UDP or TCP)

  • for windows

    image.png

  • unlike FTP, SMB is secure and have specific access rules for Users and also common public shares

AspectNFSSMB
Native OSUnix/LinuxWindows
Auth modelUID/GIDUser accounts
Encryptionv4 onlySMB3
Firewallv4 easyEasy
ACLsPOSIXNTFS
PerformanceHigh (Linux)High (Windows)
AD integrationWeakNative

telnet <hostname> <port>

This command checks if this specific port is open or not (accepting connections or not)

image.png

image.png

  • similar to Telnet but Uses strong encryption

    image.png

    image.png

    image.png

    image.png

    image.png

image.png

  • also allows remote clients accessing physical resources like printers on server environement

How SSH Works


  • Client opens TCP connection to server
  • Default port: 22
  • Server is listening for SSH connections

  • Server sends:
    • Supported encryption protocols
    • Supported protocol versions
  • Client compares with its supported list
  • A common protocol + version is selected
  • SSH session initialization begins

  • Server presents its asymmetric public key
  • Client verifies this key (known host check)
  • Confirms server authenticity

4. Diffie-Hellman key exchange (key creation)

Section titled “4. Diffie-Hellman key exchange (key creation)”
  • Client and server agree on:
    • A large prime number (shared, public)
    • A generator (public)

  • Client generates a private random number
  • Server generates a private random number
  • These private values are never shared

  • Client computes a public value using:
    • Its private number
    • Shared prime & generator
  • Server does the same
  • Public values are exchanged

  • Client uses:
    • Its private number
    • Server’s public value
    • Shared prime
  • Server uses:
    • Its private number
    • Client’s public value
    • Shared prime
  • Both independently compute the same shared secret

  • Shared secret is used to derive:
    • Symmetric encryption key
  • This key will encrypt and decrypt all traffic

  • SSH switches to symmetric encryption
  • All further communication is encrypted

  • Client authenticates using:
    • Password or
    • SSH public key
  • Authentication data travels inside encrypted tunnel
  • Server verifies credentials

  • If authentication succeeds:
    • Server opens requested shell environment
  • Client can now:
    • Execute commands
    • Receive output

  • Inputs → encrypted → server
  • Outputs → encrypted → client
  • Session continues until terminated

SSH establishes a TCP connection, negotiates encryption, verifies the server, securely creates a shared symmetric key using Diffie-Hellman, authenticates the user, and then opens an encrypted shell session.