SCP is a Linux command-line tool to transfer a file to, from, or between different hosts. It uses SSH for data transfer and runs over TCP port 22 by default.
To copy a file from the remote host to local host:
1 |
# scp username@remotehost/IP_address:[filename] [/local_target_directory] |
To copy a file from the local host to remote host:
1 |
# scp [filename] username@remotehost/IP_address:[/target_directory] |
To copy a directory from a local host to remote host:
1 |
# scp -r [directory_name] username@remotehost/IP_address:[/target_directory] |
To copy a file from the local host to remote host using a different port number other than default port 22:
1 |
# scp -P [port_number] [filename] username@remotehost/IP_address:[/target_directory] |