Slide 1

Slide 1 text

SSH, File Transfers and Rsync By Abdulhafeez AbdulRaheem (HNDRX)

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

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.

Slide 4

Slide 4 text

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.

Slide 5

Slide 5 text

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.

Slide 6

Slide 6 text

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`

Slide 7

Slide 7 text

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.

Slide 8

Slide 8 text

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.

Slide 9

Slide 9 text

How to use Rsync ● Currently: `rsync -avz /home/user/Documents/ [email protected]:/backup/user/Documents/` ● In the past: The ultimate Rsync User

Slide 10

Slide 10 text

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/`

Slide 11

Slide 11 text

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.

Slide 12

Slide 12 text

Questions

Slide 13

Slide 13 text

Thank You!