SCP (Secure Copy)
SCP stands for “secure copy”.
””” SCP (secure copy) is a command-line utility that allows you to securely copy files and directories between two locations.
With scp, you can copy a file or directory:
- From your local system to a remote system.
- From a remote system to your local system.
- Between two remote systems from your local system. When transferring data with scp, both the files and password are encrypted so that anyone snooping on the traffic doesn’t get anything sensitive. “””
Reference: How to Use SCP Command to Securely Transfer Files
Setup
To use SCP you must have ssh enabled on both computers.
View SSH (Secure Shell) section.
SCP Man
””” scp copies files between hosts on a network. It uses ssh(1) for data transfer, and uses the same authentication and provides the same secu‐ rity as ssh(1). scp will ask for passwords or passphrases if they are needed for authentication. “””
Reference: man7.org - scp(1) — Linux manual page
Syntax
Simplified
scp [OPTION] [user@]SRC_HOST:]file1 [user@]DEST_HOST:]file2
Complete
> scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file] [-l limit] [-o ssh_option] [-P port] [-S program] [[user@]host1:]file1 ... [[user@]host2:]file2
Reference: linux.die.net - scp(1) - Linux man page
Copy a file via from local directory to VM
-
find the vm’s ip address
-
find your username
-
run the following command.
> scp ./SaveToWord.py stephtan@10.0.0.116:~
stephtan@10.0.0.116's password:
SaveToWord.py 100% 1767 1.7MB/s 00:00
C:\Users\stetan2\Documents\GitHub\Python-Export-Report>
Copy a directory from local to VM
-
find the vm’s ip address
-
find your username
-
run the following command.
The command copies a folder from the current folder to user’s root directory. the ~
indicates user’s home (user’s root) directory.
> scp -r ./<folderName> stephtan@10.0.0.221:~/<folderName>
Journal
- 2020.06.26 Created SCP file