What is SCP?
SCP stands for "Secure Copy" and is a command-line tool used to transfer files securely between computers. It uses the SSH protocol for authentication, making it significantly more secure than FTP, which transmits passwords in plain text.
Simple and Efficient for Basic Transfers
SCP is designed for simple file transfer tasks. You can use it to:
- Upload or download single files: This is perfect for quickly moving a specific file from one location to another.
- Recursively upload or download entire folders: Use this to transfer all files within a folder and its subfolders.
- Use wildcards: Transfer multiple files that match a specific pattern, like "*.pdf".
When to Use SCP
- Small-scale transfers: Need to move a few files or folders? SCP is ideal for quick and secure transfer.
- Scripting: Automate file transfers in scripts for repetitive tasks.
- Limited user interface: Prefer command-line tools and don't require a graphical interface for browsing files.
When to Use SFTP Instead
- Need a graphical user interface: Want to browse and manage files visually? Choose SFTP, which offers a user-friendly interface.
- Transferring large files: Need to move large files? Consider SFTP, as it may be faster and more reliable for large data transfers.
Enabling SCP
- Open the Cerberus Admin Portal.
- Click "Server Manager" (or "Configure" for version 10 or below).
- Go to the "Listeners" tab.
- Select the SFTP interface you want to enable SCP on (not the default SFTP interface).
- Check the "Allow the SCP protocol" box.
- Click "Update" to save your settings.
Sending and Retrieving Files
Sending a File:
scp money.pdf dana@servername.com:/home/dana/hr/
Syntax: scp [file] [user]@[server]:[/path/to/destination/]
Copies the local file 'money.pdf' to the directory '/home/dana/he/' on the server as the user 'dana'.
Retrieving a File:
scp dana@servername.com:/home/dana/hr/money.pdf Download/
Syntax: scp [user]@[server]:[/path/to/target/file] [local destination]
Copies the file 'money.pdf' from its location on the server to the local directory called 'Download' as the user 'dana'.
Wildcard File Transfers:
SCP can also be used with wildcard statements (*) to transfer multiple files that meet your criteria:scp dana@servername.com:/home/dana/hr/*.pdf Download/
Syntax: scp [user]@[server]:[/path/to/target/*wildcard*] [local destination]
Copies all files ending in '.pdf' in the '/home/dana/hr' directory to the local directory called 'Download' as the user 'dana'.
Wildcards can be used for both sending and receiving files.
Comments
0 comments
Please sign in to leave a comment.