Aim :
Learn how to use SCP for secure file transfers between local and remote machines.
SCP Commands: A Step-by-Step Guide
SCP (Secure Copy Protocol) is a secure file transfer method that uses the SSH protocol. It allows you to securely copy files between your local machine and remote servers. Follow these steps to use SCP for file transfers.
Guidance on How to Use:
Prerequisite:
Ensure that you have SSH installed on both the local and remote machines.
SCP Commands:
- Copy a file from local to remote:
Example:scp [file] [YourUsername]@[YourServer]:[destination]
scp myfile.txt username@remote-server:/path/to/destination/
- Copy a file from remote to local:
Example:scp [YourUsername]@[YourServer]:[remote-file] [local-destination]
scp username@remote-server:/path/to/remote-file.txt /local/path/
- Copy an entire directory from local to remote:
Example:scp -r [directory] [YourUsername]@[YourServer]:[destination]
scp -r mydirectory username@remote-server:/path/to/destination/
- Copy an entire directory from remote to local:
Example:scp -r [YourUsername]@[YourServer]:[remote-directory] [local-destination]
scp -r username@remote-server:/path/to/remote-directory /local/path/
Verification:
Verify the file transfer by checking the destination on the local or remote machine.
Comments
Post a Comment