SCP File Transfer Example
SCP File Transfer Example
To copy a file from your Mac to a Linux server using scp, follow these steps:
bash
Copy code
scp /path/to/local/file username@remote_server:/path/to/remote/directory
/path/to/local/file: The full path to the file on your Mac that you want to copy.
username: Your username on the Linux server.
remote_server: The IP address or hostname of the Linux server.
/path/to/remote/directory: The path on the Linux server where you want the file to
be copied.
Example
bash
Copy code
scp ~/Documents/myfile.txt [email protected]:/home/user/destination_folder
Additional Tips:
If the Linux server uses a different SSH port (e.g., port 2222), specify it using
the -P flag:
bash
Copy code
scp -P 2222 ~/Documents/myfile.txt [email protected]:/home/user/destination_folder
You will be prompted to enter your password for the Linux server unless you're
using SSH keys for authentication.