If you are accustomed to working with a graphical interface, such as Windows or Mac OS, having to manage your server from the command line can be arduous, but it is sometimes necessary. In some situations, for example, you might need to send a file directly from the server without jeopardizing security.
Assuming you are already logged into your server via SSH, you can also use the secure shell to send files. The command that handles this is called SCP, which stands for Secure Copy. SCP encrypts the file and any passwords, unlike FTP or RCP.
Sending files only involves a single line of commands. For example, if you wanted to send a file called “database.sql” to your backup server at “mybackup.me”, you would enter the following:
scp database.sql email@example.com:/home/username/sqlbackup
Replace “username” with your actual username on the backup server, and the path after the “:” should match the actual path on the backup server where you want the copied file stored.
After you finish, you do not even need to disconnect. The connection will only stay open as long as SCP is sending the file. For more advanced SCP tips, type “man scp” from the command line.
Image: Wikimedia Commons