scp is a secure way of transferring files from one computer to another. It uses ssh to transfer files, safely and securely.
In order to transfer files from one computer to another, type the following command:
scp /location/of/the/file username@ip_address_of_remote_computer:/location
For example:
scp ~/apple.png [email protected]:/amogh/home/Downloads
If you want to send an entire folder, you can do that by using -r
flag:
scp /location/of/the/folder username@ip_address_of_remote_computer:/location
For example:
scp -r ~/Downloads/MyDownloads [email protected]:/amogh/home/
If you have multiple ssh keys, you have to specify a particular one using -i
flag:
scp -i ~/.ssh/spcific_key /location/of/the/folder username@ip_address_of_remote_computer:/location
For example:
scp -i ~/.ssh/SecondKey ~/Downloads/MyDownloads [email protected]:/amogh/home/
Follow me on other social media