To send files securely, you can use scp (Secure Copy Protocol) or sftp (SSH File Transfer Protocol), both of which use SSH for encryption. Here’s how to use each method:
Using scp
-
Open a Terminal.
-
Send the File: Use the following command:
scp /path/to/local_file username@remote_host:/path/to/remote_directory- Replace
/path/to/local_filewith the path to the file you want to send. - Replace
usernamewith your remote username. - Replace
remote_hostwith the IP address or hostname of the remote server. - Replace
/path/to/remote_directorywith the destination directory on the remote server.
- Replace
Using sftp
-
Open a Terminal.
-
Connect to the Remote Host:
sftp username@remote_host -
Navigate to the Desired Directory (if needed):
cd /path/to/remote_directory -
Send the File:
put /path/to/local_file
Additional Security Tips
- Use SSH Keys: For added security, consider using SSH keys instead of passwords.
- Verify Host Key: Always verify the host key when connecting to a new server.
If you have any questions or need further assistance, feel free to ask!
