SCP

From DikapediaV2
Jump to: navigation, search


SCP - Secure copy (remote file copy program)



Examples:

# Copy files from current directory in local machine to remote host:
scp -i "/home/ardika/.ssh/main_ardika_vm_key" ec2_instance.sh num_files_dir.sh subnet_script.sh subnet_script_v2.sh  ardika@3.83.174.147:git_scripts
# Copy files from remote host directory to local machine:
scp -i "~/.ssh/ireland_key" ec2-user@54.216.87.247:~/packetcap.pcap ~/Downloads/


Use SCP to download/upload file from/to Linux VM to local Windows PC


You can use scp on Windows using Powershell. To download file from remote server, command is pretty much the same

scp <user>@<remote_host_ip>:/home/ardika/some_file.txt "C:\local directory"

To upload to remote server:

scp "C:\local directory" <user>@<remote_host_ip>:/home/ardika/