Upgrade to Pro — share decks privately, control downloads, hide ads and more …

SSH, File Transfers and Rsync

SSH, File Transfers and Rsync

A talk about SSH, File Transfers and Rsync.

Abdulhafeez Abdulraheem

September 01, 2024
Tweet

More Decks by Abdulhafeez Abdulraheem

Other Decks in Technology

Transcript

  1. Who is blud? • Senior Software Engineer at Whitepaper.id •

    Currently mostly focusing on Large data transfers, Api Integrations and Golang. • I am a sweet boy. • Lover of math’s, chess and music. • I leetcode mainly in rust (Vanity) • You can find interesting stuff about me at https://hndrx.dev
  2. What is SSH? [rfc4253] • It’s a Shell. • It’s

    not just a shell, it’s a network protocol that gives users a secure way to access a computer over an unsecure network. • A “network” protocol are just predefined rules and format for sending and receiving data over the network.
  3. How does SSH work? • It is a server (a

    computer - 🤫 don’t tell no one). • Accessed through key based authentication. ◦ Private Keys ◦ Public Keys • ssh to server -> server checks if public keys -> server sends encrypted challenge to ssh client -> ssh client attempts to decrypt using private key -> If successful server grants access.
  4. So What Makes SSH secure • What are these secure

    network protocol? ◦ SSH-TRANS - Server Authentication, Data Integrity using encryption. ◦ SSH-USERAUTH - Client Authentication via public key / password. ◦ SSH-CONN - Multiple terminal sessions over one connection; A multiplexer.
  5. Grab a Linux Server and Make it an SSH Server

    Just run these; • sudo apt-get update • sudo apt-get install openssh-server • sudo systemctl status ssh Most Linux Distros’ come with the OpenSSH client pre installed; You can verify with: `ssh -V` Else run: `sudo apt-get install openssh-client`
  6. SFTP? Secure FTP 🫣 • FTP was the default file

    transfer protocol • Key Differences: ◦ SFTP run’s over SSH, everything is encrypted. FTP just a TCP server, Not encrypted by default but we can add additional SSL/TLS which gives us FTPS. ◦ SFTP Offers Interactive session and wide range of file management commands. FTP provides all but lacks the security of ssh.
  7. Rsync (Remote Synchronization) • Very Powerful and Versatile file synchronization

    tool to efficiently transfer and synchronize files and directories between local and remote systems. • Uses the Delta Transfer Algorithm, such that it splits files into small blocks and compares them; if a block has changed, only that block is transferred, rather than the entire file. • Used for: ◦ Backing up large files efficiently ▪ Used with Cron jobs to ensure efficient backup. ◦ Mirroring Directories ◦ File synchronization across multiple servers ▪ Imagine how S3 distributes your single image across multiple CDN’s in different regions efficiently.
  8. Rsync Over SSH • Combining Rsync with SSH allows for

    secure file transfers. By default, Rsync can use SSH for remote transfers, ensuring that the data is encrypted during transit. For example: `rsync -avz -e ssh /local/directory/ user@remotehost:/remote/directory/`
  9. Key Takeaways 1. SSH provides secure remote access and file

    transfers, ensuring encrypted communication and protection against unauthorized access. 2. Rsync offers efficient file synchronization by transferring only changes, making it ideal for backups and data mirroring. 3. Combining Rsync with SSH enhances security, ensuring that file transfers are both efficient and encrypted.