How to transfer files over ssh

This is a handy command I often need to use:

scp <filename> <user>@<address>:<destination>

Ex:

scp ~/Downloads/*.txt root@192.168.2.190:/home/dev

and if you need to specify your private key

scp -i ~/.ssh/myprivatekey.ppk root@192.168.2.190:/home/dev
Advertisements