SCP - Secure Copy Protocol ============================= .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **What is SCP?** SCP (Secure Copy Protocol) is a network protocol used to securely transfer files between a local host and a remote host or between two remote hosts. It is based on the SSH (Secure Shell) protocol, ensuring encrypted file transfers over insecure networks. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Why is SCP useful?** * Secure file transfer – Uses SSH for encryption, ensuring confidentiality and integrity. * Simple and fast – Command-line based and efficient for quick file transfers. * Authentication support – Leverages SSH keys or passwords for secure access. * Cross-platform – Available on Unix/Linux, macOS, and Windows (via tools like PuTTY or OpenSSH). * No setup required on the server – If SSH is enabled, SCP works out of the box. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **How does it work?** * User runs the `scp` command specifying the source and destination paths. * SCP uses SSH to authenticate the user on the remote system. * An encrypted SSH tunnel is established for the file transfer. * Data is securely copied from the source to the destination. * Once complete, the SSH session is terminated. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Where is SCP used?** * System administration – Moving configuration files or logs between servers. * DevOps workflows – Automating deployments or backups in scripts. * Remote development – Transferring code or assets to remote environments. * Secure backups – Copying files to remote backup servers. * IoT and embedded systems – Transferring firmware or logs securely. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Which OSI Layer does this protocol belong to?** * SCP operates at the **Session Layer (Layer 5)** of the OSI model. * It establishes and manages a secure session via SSH. * Operates above the transport layer (TCP), focusing on secure session-level communication and file transfer. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Topics in this section, * :ref:`Learnings in this section ` * :ref:`Terminology ` * :ref:`Version Info ` * :ref:`SCP Version&RFC Details ` * :ref:`SCP Basic Setup on Ubuntu using IPv4 ` * :ref:`SCP Basic Setup on Ubuntu using IPv6 ` * :ref:`SCP Protocol Packet Details ` * :ref:`SCP Usecases ` * :ref:`SCP Basic Features ` * :ref:`SCP Feature : SSH-Based Security, ` * :ref:`SCP Feature : Simple Command-Line Interface ` * :ref:`SCP Feature : Bidirectional Transfer ` * :ref:`SCP Feature : Recursive Copy ` * :ref:`SCP Feature : Preserves File Attributes ` * :ref:`SCP Feature : Cross-Platform Compatibility ` * :ref:`SCP Feature : No Need for Additional Setup ` * :ref:`SCP Feature : Script-Friendly ` * :ref:`Reference links ` .. _SCP_step1: .. tab-set:: .. tab-item:: Learnings in this section * In this section, you are going to learn .. _SCP_step2: .. tab-set:: .. tab-item:: Terminology * Terminology .. _SCP_step3: .. tab-set:: .. tab-item:: Version Info * Version Info .. _SCP_step5: .. tab-set:: .. tab-item:: SCP Version&RFC Details .. csv-table:: :file: ./SCP/SCP_rfcdetails.csv :widths: 10,10,10,30 :header-rows: 1 .. _SCP_step19: .. tab-set:: .. tab-item:: SCP Basic Setup on Ubuntu using IPv4 * setup .. _SCP_step20: .. tab-set:: .. tab-item:: SCP Basic Setup on Ubuntu using IPv6 * setup .. _SCP_step6: .. tab-set:: .. tab-item:: SCP Protocol Packet Details **SSH Transport Layer Packet** .. csv-table:: :file: ./SCP/SCP_packetdetails1.csv :widths: 10,20,30,10 :header-rows: 1 **SSH User Authentication Packet** .. csv-table:: :file: ./SCP/SCP_packetdetails2.csv :widths: 10,20,30,10 :header-rows: 1 **SSH Channel Open Packet** .. csv-table:: :file: ./SCP/SCP_packetdetails3.csv :widths: 10,20,30,10 :header-rows: 1 **SCP Command Execution Packet** .. csv-table:: :file: ./SCP/SCP_packetdetails4.csv :widths: 10,20,30,10 :header-rows: 1 **SCP Timestamp Packet (T) Packet** .. csv-table:: :file: ./SCP/SCP_packetdetails5.csv :widths: 10,20,30,10 :header-rows: 1 **SCP File Info Packet (C) Packet** .. csv-table:: :file: ./SCP/SCP_packetdetails6.csv :widths: 10,20,30,10 :header-rows: 1 **SCP Directory Info Packet (D) Packet** .. csv-table:: :file: ./SCP/SCP_packetdetails7.csv :widths: 10,20,30,10 :header-rows: 1 **SCP End Directory Packet (E) Packet** .. csv-table:: :file: ./SCP/SCP_packetdetails8.csv :widths: 10,20,30,10 :header-rows: 1 **SCP File Data Packet** .. csv-table:: :file: ./SCP/SCP_packetdetails9.csv :widths: 10,20,30,10 :header-rows: 1 **SCP Acknowledgment Packet** .. csv-table:: :file: ./SCP/SCP_packetdetails10.csv :widths: 10,20,30,10 :header-rows: 1 **SSH Channel Close Packet** .. csv-table:: :file: ./SCP/SCP_packetdetails11.csv :widths: 10,20,30,10 :header-rows: 1 .. _SCP_step7: .. tab-set:: .. tab-item:: SCP Usecases .. csv-table:: :file: ./SCP/SCP_usecases.csv :widths: 10,20,30 :header-rows: 1 .. _SCP_step8: .. tab-set:: .. tab-item:: SCP Basic Features .. csv-table:: :file: ./SCP/SCP_basicfeatures.csv :widths: 10,10,30 :header-rows: 1 .. _SCP_step9: .. tab-set:: .. tab-item:: SCP Feature : SSH Based Security **SSH Based Security - Testcases** .. csv-table:: :file: ./SCP/SCP_feature1_SSH_Based_Security_testcases.csv :widths: 10,10,30,20 :header-rows: 1 .. _SCP_step10: .. tab-set:: .. tab-item:: SCP Feature : Simple Command Line Interface **Simple Command Line Interface - Testcases** .. csv-table:: :file: ./SCP/SCP_feature2_Simple_Command_Line_Interface_testcases.csv :widths: 10,10,30,20 :header-rows: 1 .. _SCP_step11: .. tab-set:: .. tab-item:: SCP Feature : Bidirectional Transfer **Bidirectional Transfer - Testcases** .. csv-table:: :file: ./SCP/SCP_feature3_Bidirectional_Transfer_testcases.csv :widths: 10,10,30,20 :header-rows: 1 .. _SCP_step12: .. tab-set:: .. tab-item:: SCP Feature : Recursive Copy **Recursive Copy - Testcases** .. csv-table:: :file: ./SCP/SCP_feature4_Recursive_Copy_testcases.csv :widths: 10,10,30,20 :header-rows: 1 .. _SCP_step13: .. tab-set:: .. tab-item:: SCP Feature : Preserves File Attributes **Preserves File Attributes - Testcases** .. csv-table:: :file: ./SCP/SCP_feature5_Preserves_File_Attributes_testcases.csv :widths: 10,10,30,20 :header-rows: 1 .. _SCP_step14: .. tab-set:: .. tab-item:: SCP Feature : Cross Platform Compatibility **Cross Platform Compatibility - Testcases** .. csv-table:: :file: ./SCP/SCP_feature6_Cross_Platform_Compatibility_testcases.csv :widths: 10,10,30,20 :header-rows: 1 .. _SCP_step15: .. tab-set:: .. tab-item:: SCP Feature : No Need for Additional Setup **No Need for Additional Setup - Testcases** .. csv-table:: :file: ./SCP/SCP_feature7_No_Need_for_Additional_Setup_testcases.csv :widths: 10,10,30,20 :header-rows: 1 .. _SCP_step16: .. tab-set:: .. tab-item:: SCP Feature : Script Friendly **Script Friendly - Testcases** .. csv-table:: :file: ./SCP/SCP_feature8_Script_Friendly_testcases.csv :widths: 10,10,30,20 :header-rows: 1 .. _SCP_step18: .. tab-set:: .. tab-item:: Reference links * Reference links