--- title: Introduction to SCP image: https://i.imgur.com/jsl3sHE.png --- :::warning # <center><i class="fa fa-book"></i> Introduction to SCP </center> ::: ###### tags: `study` `SCP` ![](https://i.imgur.com/jsl3sHE.png =400x) :::success **🎯 Goals:** - [x] - <a href="#Module-1-Introduction">A brief introduction to SCP</a> - [ ] - <a href="">Summary </a> ::: :::info :bookmark: **Reference:** - [link](https://) ::: [toc] # Module 1: Introduction ![](https://i.imgur.com/19jU6SV.png) ## 1.1 What are SCP Commands? - `SCP` is an acronym for `Secure Copy Protocol`. - It is a command line utility that allows the user to securely copy files and directories between two locations usually between `unix` or `linux` systems. The protocol ensures the transmission of files is encrypted to prevent anyone with suspicious intentions from getting sensitive information. In simpler words we can say that SCP is a safer option for the cp (copy) command. It is also important to note that SCP uses encryption over an SSH (Secure Shell) connection, this ensures that the data being transferred is protected from suspicious attacks. ## 1.2 SCP Syntax ```cmd= scp [OPTIONS] [[user@]src_host:]file1 [[user@]dest_host:]file2 ``` - `src_host` - where the file is hosted. The source can either be a client or server depending on the origin of the file. - `dest_host` - where the file will be copied to. :::danger **SCP permission denied** - Beacuse Ubuntu defaults to having permission to extract files in **`/tmp`** ::: :::success **For Example:** - If you need to transfer files, you can **copy or move** the files to the folder (/tmp) first, and then transfer them through SCP smoothly. - **Command: mv (cut and paste)** ```cmd= mv <FILE> <PATH><FILE> mv E2SIM_package1.pcap /tmp/toMingData/E2SIM_package1.pcap ``` > **Need to give a new name**[color=orange] - **Command: cp (copy and paste)** ```cmd= cp <FILE_1> <FILE_2> <PATH> cp user1.txt E2SIM_package1.pcap /tmp/toMingData/ ``` - **++Transfer++ files from ==server== side (Ubuntu)** ![](https://i.imgur.com/VcXJglS.png) This will **download all files** from the folder in the server (send2Ming) to my windows local folder (reciveData) ```cmd= scp -i ric-yh.pem ubuntu@192.168.8.218:/tmp/send2Ming/* ./reciveData ``` - **++Receive++ files on my ==local== side (windows)** ![](https://i.imgur.com/7NqhK6f.png) ::: ## 1.3 SCP following cases: - Copy files within same machine. - Copy files from a local host to remote host and vice versa. - Copy files between two different remote servers. # Module End: Summary ---- <!-- >**Name**: `名稱` --> <style> /* 僅指定連結的圖片去背且靠右模擬置中 */ img[src^="https://i.imgur.com/jsl3sHE.png"]{ position: relative; left: 20%; background-color: #fff0; } .title { color: #009933; font-weight:bold; } .highlight { color: #ff4d4d; font-weight:bold; border-bottom:2px red solid; padding-bottom:2px; } </style> <!-- <font class="highlight"> --> <!-- <font class="title"> --> <!-- 縮寫提示 --> <!-- *[O-RAN]:Open Radio Access Network -->