SCP from local to remote

If you ever find yourself needing to move files or folders from your local machine up to a remote server, you can do so using the SCP command. Your remote server will need to have your public key and then you can run the following command:

scp root@

In the command above, after the scp command you will then pass the file you with to move to your remote server.

After the file you will specify the user@ip_address, then add a :, and the location of where you want to move that file on the server /var/www

If you wish to move a folder recursively up to your server you will want to pass the -r flag like so:

scp -r folder_name root@
Back to DevDojo