Secure copy protocol

Wanted to learn about SCP because, today, I needed to move something from a server to my local machine and I forgot about the scp command which would have made it easier.

Date Created:

References



Notes


Secure Copy protocol (SCP) is a means of securely transferring computer files between a local host and a remote host or between two remote hosts. It is based on the Secure Shell (ssh) protocol. "SCP" commonly refers to both the Secure Copy Protocol and the program itself. According to OpenSSH developers in April 2019, SCP is outdated [...] and they recommend the use of more modern protocols like SFTP and rsync for file transfer.
  • The SCP is a network protocol which supports file transfers between hosts on a network. SCOP uses Secure Shell (SSH) for data transfer and uses the same mechanisms for authentication, thereby ensuring the authenticity and confidentiality of the data in transit. A client can upload files and request files from the server.
  • The remote SCP process can operate in one of two modes:
    • source mode, which reads files (usually from disk) and sends them back to the client
    • sink mode, which accepts the files sent by the client and writes them (usually to disk) on the remote host.
  • The SCP program is a software tool implementing the SCP protocol as a service daemon or client. It is a program to perform secure copying.
  • The most widely used SCP program is the OpenSSH command line scp program, which is provided in most SSH implementations. The scp program is the secure analog of the rcp command.

Syntax

$ scp <LocalSourceFile> <user@remotehost:directory/TargetFile> # Copying file to remote host
$ # Copuing file from remote host and recursively copying folder from remote host
$ scp user@remotehost:directory/SourceFile LocalTargetFile
$ scp -r user@host:directory/SourceFolder LocalTargetFolder
  • The Secure Copy Protocol implements file transfers only, GUI SCP clients are rare, as implementing it requires additional functionality.

Insert Math Markup

ESC
About Inserting Math Content
Display Style:

Embed News Content

ESC
About Embedding News Content

Embed Youtube Video

ESC
Embedding Youtube Videos

Embed TikTok Video

ESC
Embedding TikTok Videos

Embed X Post

ESC
Embedding X Posts

Embed Instagram Post

ESC
Embedding Instagram Posts

Insert Details Element

ESC

Example Output:

Summary Title
You will be able to insert content here after confirming the title of the <details> element.

Insert Table

ESC
Customization
Align:
Preview:

Insert Horizontal Rule

#000000

Preview:


Insert Chart

ESC

View Content At Different Sizes

ESC

Edit Style of Block Nodes

ESC

Edit the background color, default text color, margin, padding, and border of block nodes. Editable block nodes include paragraphs, headers, and lists.

#ffffff
#000000

Edit Selected Cells

Change the background color, vertical align, and borders of the cells in the current selection.

#ffffff
Vertical Align:
Border
#000000
Border Style:

Edit Table

ESC
Customization:
Align:

Upload Lexical State

ESC

Upload a .lexical file. If the file type matches the type of the current editor, then a preview will be shown below the file input.

Upload 3D Object

ESC

Upload Jupyter Notebook

ESC

Upload a Jupyter notebook and embed the resulting HTML in the text editor.

Insert Custom HTML

ESC

Edit Image Background Color

ESC
#ffffff

Insert Columns Layout

ESC
Column Type:

Select Code Language

ESC
Select Coding Language